radv: save/restore the stencil reference during internal driver operations
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 31 Mar 2022 18:20:35 +0000 (20:20 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 4 Apr 2022 06:31:11 +0000 (06:31 +0000)
I think I should improve this to be more robust.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6243
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15700>

src/amd/vulkan/radv_meta.c
src/amd/vulkan/radv_meta.h
src/gallium/drivers/zink/ci/zink-radv-fails.txt

index dcbc554164d54f6d4eee90572221b029e4cae02d..fa97e8b13241e7d05cdd98cf4bf2921805fd3cc7 100644 (file)
@@ -121,6 +121,9 @@ radv_meta_save(struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_
       state->stencil_write_mask.front = cmd_buffer->state.dynamic.stencil_write_mask.front;
       state->stencil_write_mask.back = cmd_buffer->state.dynamic.stencil_write_mask.back;
 
+      state->stencil_reference.front = cmd_buffer->state.dynamic.stencil_reference.front;
+      state->stencil_reference.back = cmd_buffer->state.dynamic.stencil_reference.back;
+
       state->fragment_shading_rate.size = cmd_buffer->state.dynamic.fragment_shading_rate.size;
       state->fragment_shading_rate.combiner_ops[0] =
          cmd_buffer->state.dynamic.fragment_shading_rate.combiner_ops[0];
@@ -220,6 +223,9 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf
       cmd_buffer->state.dynamic.stencil_write_mask.front = state->stencil_write_mask.front;
       cmd_buffer->state.dynamic.stencil_write_mask.back = state->stencil_write_mask.back;
 
+      cmd_buffer->state.dynamic.stencil_reference.front = state->stencil_reference.front;
+      cmd_buffer->state.dynamic.stencil_reference.back = state->stencil_reference.back;
+
       cmd_buffer->state.dynamic.fragment_shading_rate.size = state->fragment_shading_rate.size;
       cmd_buffer->state.dynamic.fragment_shading_rate.combiner_ops[0] =
          state->fragment_shading_rate.combiner_ops[0];
@@ -243,7 +249,7 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf
          RADV_CMD_DIRTY_DYNAMIC_DEPTH_WRITE_ENABLE | RADV_CMD_DIRTY_DYNAMIC_DEPTH_COMPARE_OP |
          RADV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS_TEST_ENABLE |
          RADV_CMD_DIRTY_DYNAMIC_STENCIL_TEST_ENABLE | RADV_CMD_DIRTY_DYNAMIC_STENCIL_OP |
-         RADV_CMD_DIRTY_DYNAMIC_STENCIL_WRITE_MASK |
+         RADV_CMD_DIRTY_DYNAMIC_STENCIL_WRITE_MASK | RADV_CMD_DIRTY_DYNAMIC_STENCIL_REFERENCE |
          RADV_CMD_DIRTY_DYNAMIC_FRAGMENT_SHADING_RATE | RADV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS_ENABLE |
          RADV_CMD_DIRTY_DYNAMIC_PRIMITIVE_RESTART_ENABLE |
          RADV_CMD_DIRTY_DYNAMIC_RASTERIZER_DISCARD_ENABLE | RADV_CMD_DIRTY_DYNAMIC_LOGIC_OP |
index 89391bd42b27f6bcdb19036f39bb4bdcf551bb90..be065f2807786b2e510a575fa492b3002b0e9d42 100644 (file)
@@ -91,6 +91,11 @@ struct radv_meta_saved_state {
       } back;
    } stencil_op;
 
+   struct {
+      uint32_t front;
+      uint32_t back;
+   } stencil_reference;
+
    struct {
       VkExtent2D size;
       VkFragmentShadingRateCombinerOpKHR combiner_ops[2];
index 528d4582d0284c2ca86fa86f7ae97fa6a059da0b..7e016127200ceeb31b3b3b65af831d35398cab11 100644 (file)
@@ -200,8 +200,6 @@ glx@glx-visuals-depth -pixmap,Crash
 glx@glx-visuals-stencil,Crash
 glx@glx-visuals-stencil -pixmap,Crash
 
-GTF-GL46.gtf30.GL3Tests.packed_depth_stencil.packed_depth_stencil_blit,Fail
-GTF-GL46.gtf30.GL3Tests.packed_depth_stencil.packed_depth_stencil_clearbuffer,Fail
 GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_builtins,Fail
 
 KHR-GL46.blend_equation_advanced.blend_all.GL_COLORBURN_KHR_all_qualifier,Fail
@@ -235,10 +233,6 @@ KHR-GL46.blend_equation_advanced.blend_specific.GL_OVERLAY_KHR,Fail
 KHR-GL46.blend_equation_advanced.blend_specific.GL_SCREEN_KHR,Fail
 KHR-GL46.blend_equation_advanced.blend_specific.GL_SOFTLIGHT_KHR,Fail
 KHR-GL46.gpu_shader_fp64.fp64.varyings,Fail
-KHR-GL46.packed_depth_stencil.blit.depth24_stencil8,Fail
-KHR-GL46.packed_depth_stencil.blit.depth32f_stencil8,Fail
-KHR-GL46.packed_depth_stencil.clear_buffer.depth24_stencil8,Fail
-KHR-GL46.packed_depth_stencil.clear_buffer.depth32f_stencil8,Fail
 KHR-GL46.shader_ballot_tests.ShaderBallotFunctionRead,Fail
 KHR-GL46.shader_image_load_store.basic-allTargets-atomicCS,Fail
 KHR-GL46.shader_image_load_store.basic-allTargets-atomicGS,Fail