Mesa (master): zink: set compareEnable when setting compareOp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 28 21:27:37 UTC 2020


Module: Mesa
Branch: master
Commit: b175effc7252f9e73dd78dfac0380cae69966234
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b175effc7252f9e73dd78dfac0380cae69966234

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Jan 20 17:35:55 2020 +0100

zink: set compareEnable when setting compareOp

We need to enable compareEnable for compareOp to be valid, and ANV was
recently updated to respect this. So let's update Zink to match.

This fixes the shadow-variants of several piglit regressions, like these:
spec at arb_shader_texture_lod@execution at tex-miplevel-selection
spec at glsl-1.20@execution at tex-miplevel-selection

Fixes: a19cdf989b1 ("anv: only use VkSamplerCreateInfo::compareOp if enabled")
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3473>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3473>

---

 src/gallium/drivers/zink/zink_context.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index f79e289727d..f2b9044bc2b 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -140,8 +140,10 @@ zink_create_sampler_state(struct pipe_context *pctx,
 
    if (state->compare_mode == PIPE_TEX_COMPARE_NONE)
       sci.compareOp = VK_COMPARE_OP_NEVER;
-   else
+   else {
       sci.compareOp = compare_op(state->compare_func);
+      sci.compareEnable = VK_TRUE;
+   }
 
    sci.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; // TODO
    sci.unnormalizedCoordinates = !state->normalized_coords;



More information about the mesa-commit mailing list