From af338d2d2ef3796e2402e8cf0cfb392611cdb709 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Fri, 20 Sep 2024 16:54:33 +0000 Subject: [PATCH] tu: Fix incorrect bpcs value for padded formats This doesn't make a difference for now as we don't expose any padded formats yet, but will be needed for VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16. Reviewed-by: Faith Ekstrand Signed-off-by: Valentine Burley Part-of: --- src/freedreno/vulkan/tu_shader.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index 199d7478fd3..39fe9578892 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -553,10 +553,8 @@ lower_tex_ycbcr(const struct tu_pipeline_layout *layout, builder->cursor = nir_after_instr(&tex->instr); - uint8_t bits = vk_format_get_component_bits(ycbcr_sampler->format, - UTIL_FORMAT_COLORSPACE_RGB, - PIPE_SWIZZLE_X); - uint32_t bpcs[3] = {bits, bits, bits}; /* TODO: use right bpc for each channel ? */ + uint8_t bits = vk_format_get_bpc(ycbcr_sampler->format); + uint32_t bpcs[3] = {bits, bits, bits}; /* We only support uniform formats */ nir_def *result = nir_convert_ycbcr_to_rgb(builder, ycbcr_sampler->ycbcr_model, ycbcr_sampler->ycbcr_range,