From 7b2086d741920ec302d0e8830242f4555948583b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 23 Feb 2023 09:50:17 +0100 Subject: [PATCH] radv: fix border color swizzle for stencil-only format on GFX9+ Swizzle of 8-bit stencil format is defined as _x__ but the hw expects BC_SWIZZLE_XYZW. Fixes dEQP-VK.pipeline.monolithic.sampler.border_swizzle.*s8_uint*. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_image.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 74fa1ea..cda526f 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -943,6 +943,12 @@ gfx9_border_color_swizzle(const struct util_format_description *desc) { unsigned bc_swizzle = V_008F20_BC_SWIZZLE_XYZW; + if (desc->format == PIPE_FORMAT_S8_UINT) { + /* Swizzle of 8-bit stencil format is defined as _x__ but the hw expects XYZW. */ + assert(desc->swizzle[1] == PIPE_SWIZZLE_X); + return bc_swizzle; + } + if (desc->swizzle[3] == PIPE_SWIZZLE_X) { /* For the pre-defined border color values (white, opaque * black, transparent black), the only thing that matters is -- 2.7.4