From f984ff40fe449962410a1e0e259da047174d4ec5 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Fri, 2 Aug 2024 19:50:14 +0000 Subject: [PATCH] tu: Remove redundant bits override from lower_tex_ycbcr This isn't needed anymore, because vk_format_get_component_bits now accesses the proper pipe formats and therefore returns the correct bit count since the following commit: 57c81bab04b ("vulkan/format: Translate two 420_UNORM formats properly") Signed-off-by: Valentine Burley Part-of: --- src/freedreno/vulkan/tu_shader.cc | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index 473d2bc0cce..8f178bfc358 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -554,27 +554,14 @@ lower_tex_ycbcr(const struct tu_pipeline_layout *layout, uint8_t bits = vk_format_get_component_bits(ycbcr_sampler->format, UTIL_FORMAT_COLORSPACE_RGB, PIPE_SWIZZLE_X); - - switch (ycbcr_sampler->format) { - case VK_FORMAT_G8B8G8R8_422_UNORM: - case VK_FORMAT_B8G8R8G8_422_UNORM: - case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: - case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: - /* util_format_get_component_bits doesn't return what we want */ - bits = 8; - break; - default: - break; - } - uint32_t bpcs[3] = {bits, bits, bits}; /* TODO: use right bpc for each channel ? */ nir_def *result = nir_convert_ycbcr_to_rgb(builder, - ycbcr_sampler->ycbcr_model, - ycbcr_sampler->ycbcr_range, - &tex->def, - bpcs); + ycbcr_sampler->ycbcr_model, + ycbcr_sampler->ycbcr_range, + &tex->def, + bpcs); nir_def_rewrite_uses_after(&tex->def, result, - result->parent_instr); + result->parent_instr); builder->cursor = nir_before_instr(&tex->instr); }