zink: workaround depth sampler border color when z24 is z32
authorDave Airlie <airlied@redhat.com>
Wed, 29 Jun 2022 21:06:15 +0000 (07:06 +1000)
committerMarge Bot <emma+marge@anholt.net>
Thu, 30 Jun 2022 00:22:52 +0000 (00:22 +0000)
commitc702de7484832c1e0413120fb8e4445f95d40601
tree505e20c3a83b540b142ce81adfe9bbb8e36036b6
parentc017dfec62e448fea9ad9d16c575086b0de19b3b
zink: workaround depth sampler border color when z24 is z32

If there is a z24 unorm depth buffer, but it's the hw is using
a z32, the border color needs to be clamped appropriately.

This creates a second sampler with the clamped border color,
and uses it if needed. The checks might need some tightening up.

Fixes: zink on radv
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_unorm_depth
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_unorm_depth_uint_stencil_sample_depth

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17305>
src/gallium/drivers/zink/ci/zink-radv-fails.txt
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h