From 6d4e605378cda69ba6a00d6d83a205a9237fdc78 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 29 Mar 2023 10:02:15 -0500 Subject: [PATCH] hasvk/pipeline: Use feedback loop flags for self-dependencies Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan_hasvk/anv_genX.h | 2 -- src/intel/vulkan_hasvk/genX_pipeline.c | 16 ++++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/intel/vulkan_hasvk/anv_genX.h b/src/intel/vulkan_hasvk/anv_genX.h index ce2c9ae..2928705 100644 --- a/src/intel/vulkan_hasvk/anv_genX.h +++ b/src/intel/vulkan_hasvk/anv_genX.h @@ -38,8 +38,6 @@ struct intel_sample_positions; -typedef struct VkRenderingSelfDependencyInfoMESA VkRenderingSelfDependencyInfoMESA; - extern const uint32_t genX(vk_to_intel_cullmode)[]; extern const uint32_t genX(vk_to_intel_front_face)[]; diff --git a/src/intel/vulkan_hasvk/genX_pipeline.c b/src/intel/vulkan_hasvk/genX_pipeline.c index 4255b2a..bd13d52 100644 --- a/src/intel/vulkan_hasvk/genX_pipeline.c +++ b/src/intel/vulkan_hasvk/genX_pipeline.c @@ -1530,6 +1530,13 @@ emit_3dstate_gs(struct anv_graphics_pipeline *pipeline) } } +static bool +rp_has_ds_self_dep(const struct vk_render_pass_state *rp) +{ + return rp->pipeline_flags & + VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; +} + static void emit_3dstate_wm(struct anv_graphics_pipeline *pipeline, const struct vk_input_assembly_state *ia, @@ -1595,8 +1602,7 @@ emit_3dstate_wm(struct anv_graphics_pipeline *pipeline, * may get the depth or stencil value from the current draw rather * than the previous one. */ - wm.PixelShaderKillsPixel = rp->depth_self_dependency || - rp->stencil_self_dependency || + wm.PixelShaderKillsPixel = rp_has_ds_self_dep(rp) || wm_prog_data->uses_kill || wm_prog_data->uses_omask; @@ -1753,8 +1759,7 @@ emit_3dstate_ps_extra(struct anv_graphics_pipeline *pipeline, * around to fetching from the input attachment and we may get the depth * or stencil value from the current draw rather than the previous one. */ - ps.PixelShaderKillsPixel = rp->depth_self_dependency || - rp->stencil_self_dependency || + ps.PixelShaderKillsPixel = rp_has_ds_self_dep(rp) || wm_prog_data->uses_kill; ps.PixelShaderUsesInputCoverageMask = wm_prog_data->uses_sample_mask; @@ -1797,8 +1802,7 @@ compute_kill_pixel(struct anv_graphics_pipeline *pipeline, * of an alpha test. */ pipeline->kill_pixel = - rp->depth_self_dependency || - rp->stencil_self_dependency || + rp_has_ds_self_dep(rp) || wm_prog_data->uses_kill || wm_prog_data->uses_omask || (ms && ms->alpha_to_coverage_enable); -- 2.7.4