From 54cf12774ae66a2c3fc354af10c061fcbfba7136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Iglesias=20Gons=C3=A1lvez?= Date: Thu, 21 Jan 2021 09:55:03 +0100 Subject: [PATCH] turnip/lrz: add support for VK_EXT_extended_dynamic_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Eric Anholt Part-of: --- 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); }