Mesa (master): turnip/lrz: add support for VK_EXT_extended_dynamic_state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 15 09:42:22 UTC 2021


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

Author: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Date:   Thu Jan 21 09:55:03 2021 +0100

turnip/lrz: add support for VK_EXT_extended_dynamic_state

When the depth or stencil state changes dynamically, that might affect
LRZ state and we need to recalculate it and emit it again.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>

---

 src/freedreno/ci/deqp-freedreno-a630-fails.txt | 14 --------------
 src/freedreno/vulkan/tu_cmd_buffer.c           |  7 ++++---
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/freedreno/ci/deqp-freedreno-a630-fails.txt b/src/freedreno/ci/deqp-freedreno-a630-fails.txt
index f3639f35712..4a1e2fe698a 100644
--- a/src/freedreno/ci/deqp-freedreno-a630-fails.txt
+++ b/src/freedreno/ci/deqp-freedreno-a630-fails.txt
@@ -131,20 +131,6 @@ dEQP-VK.image.subresource_layout.3d.all_levels.r8g8b8a8_snorm,Fail
 dEQP-VK.info.device_mandatory_features,Fail
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_local.image.guard_nonlocal.workgroup.comp,Fail
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_nonlocal.workgroup.guard_local.image.comp,Fail
-dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_always_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_greater_equal_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_greater_equal_greater_then_equal,Fail
-dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_always_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_greater_equal_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_greater_equal_greater_then_equal,Fail
-dEQP-VK.pipeline.extended_dynamic_state.between_pipelines.depth_compare_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.cmd_buffer_start.depth_compare_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.two_draws_dynamic.depth_compare_always_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.two_draws_dynamic.depth_compare_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.two_draws_dynamic.depth_compare_greater_equal_greater,Fail
-dEQP-VK.pipeline.extended_dynamic_state.two_draws_dynamic.depth_compare_greater_equal_greater_then_equal,Fail
 dEQP-VK.pipeline.framebuffer_attachment.diff_attachments_2d_19x27_32x32_ms,Fail
 dEQP-VK.pipeline.push_descriptor.compute.binding0_numcalls2_combined_image_sampler,Crash
 dEQP-VK.pipeline.push_descriptor.compute.binding0_numcalls2_sampled_image,Crash
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index e68bdb31253..dbc8aa75b5b 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -3333,13 +3333,14 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
 {
    const struct tu_pipeline *pipeline = cmd->state.pipeline;
    VkResult result;
+   bool dirty_lrz = cmd->state.dirty & (TU_CMD_DIRTY_LRZ | TU_CMD_DIRTY_RB_DEPTH_CNTL | TU_CMD_DIRTY_RB_STENCIL_CNTL);
 
    struct tu_descriptor_state *descriptors_state =
       &cmd->descriptors[VK_PIPELINE_BIND_POINT_GRAPHICS];
 
    tu_emit_cache_flush_renderpass(cmd, cs);
 
-   if (cmd->state.dirty & TU_CMD_DIRTY_LRZ)
+   if (dirty_lrz)
       cmd->state.lrz.state = tu6_build_lrz(cmd);
 
    tu_cs_emit_regs(cs, A6XX_PC_PRIMITIVE_CNTL_0(
@@ -3455,7 +3456,7 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
          ((cmd->state.dirty & TU_CMD_DIRTY_SHADER_CONSTS) ? 5 : 0) +
          ((cmd->state.dirty & TU_CMD_DIRTY_DESC_SETS_LOAD) ? 1 : 0) +
          ((cmd->state.dirty & TU_CMD_DIRTY_VERTEX_BUFFERS) ? 1 : 0) +
-         ((cmd->state.dirty & TU_CMD_DIRTY_LRZ) ? 1 : 0) +
+         (dirty_lrz ? 1 : 0) +
          1; /* vs_params */
 
       if ((cmd->state.dirty & TU_CMD_DIRTY_VB_STRIDE) &&
@@ -3487,7 +3488,7 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
       }
       tu_cs_emit_draw_state(cs, TU_DRAW_STATE_VS_PARAMS, cmd->state.vs_params);
 
-      if (cmd->state.dirty & TU_CMD_DIRTY_LRZ)
+      if (dirty_lrz)
          tu_cs_emit_draw_state(cs, TU_DRAW_STATE_LRZ, cmd->state.lrz.state);
    }
 



More information about the mesa-commit mailing list