Skip to content

freedreno/fdl: use XYZW swap for PIPE_FORMAT_X24S8_UINT

Chia-I Wu requested to merge olv/mesa:tu-border-color-z24s8 into main

This is RFC. It is likely incomplete and I also need to do extenstive tests if it has any chance to work..

For PIPE_FORMAT_X24S8_UINT, we use WZYX to fetch the stencil value into the last channel and rely on PIPE_SWIZZLE_W to swizzle it to the first channel. The problem is that swizzles apply to border colors as well.

Vulkan mandates that the stencil value is in the first channel of the border color. We cannot have PIPE_SWIZZLE_W which might swizzle garbage to the first channel. The gallium driver works around this by manually putting the stencil value in the last channel in setup_border_colors. We cannot do the same unless we stop advertising customBorderColorWithoutFormat.

What this commit does is to fix swap such that the stencil value is fetched from the image to the first channel. This way the stencil value is always in the first channel and we no longer need to swizzle.

Closes: #6516 (closed)

Edited by Chia-I Wu

Merge request reports