Mesa (main): radv: use radv_pipeline_has_ds_attachments() more

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 8 06:39:44 UTC 2022


Module: Mesa
Branch: main
Commit: 465b530a1544ed11b6e73a6af306c065e61bd960
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=465b530a1544ed11b6e73a6af306c065e61bd960

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Apr  6 14:32:30 2022 +0200

radv: use radv_pipeline_has_ds_attachments() more

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15792>

---

 src/amd/vulkan/radv_pipeline.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 243a2f6b4ef..cb87d5aa092 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -876,11 +876,8 @@ radv_pipeline_depth_samples(const VkGraphicsPipelineCreateInfo *pCreateInfo)
 {
    const VkAttachmentSampleCountInfoAMD *sample_info =
       vk_find_struct_const(pCreateInfo->pNext, ATTACHMENT_SAMPLE_COUNT_INFO_AMD);
-   const VkPipelineRenderingCreateInfo *render_create_info =
-      vk_find_struct_const(pCreateInfo->pNext, PIPELINE_RENDERING_CREATE_INFO);
    if (sample_info) {
-      if (render_create_info->depthAttachmentFormat != VK_FORMAT_UNDEFINED ||
-          render_create_info->stencilAttachmentFormat != VK_FORMAT_UNDEFINED) {
+      if (radv_pipeline_has_ds_attachments(pCreateInfo)) {
          return sample_info->depthStencilAttachmentSamples;
       }
    }
@@ -6369,12 +6366,6 @@ radv_pipeline_init_extra(struct radv_pipeline *pipeline,
                          struct radv_depth_stencil_state *ds_state,
                          uint32_t *vgt_gs_out_prim_type)
 {
-   const VkPipelineRenderingCreateInfo *render_create_info =
-      vk_find_struct_const(pCreateInfo->pNext, PIPELINE_RENDERING_CREATE_INFO);
-
-   bool has_depth_attachment = render_create_info->depthAttachmentFormat != VK_FORMAT_UNDEFINED;
-   bool has_stencil_attachment = render_create_info->stencilAttachmentFormat != VK_FORMAT_UNDEFINED;
-
    if (extra->custom_blend_mode == V_028808_CB_ELIMINATE_FAST_CLEAR ||
        extra->custom_blend_mode == V_028808_CB_FMASK_DECOMPRESS ||
        extra->custom_blend_mode == V_028808_CB_DCC_DECOMPRESS ||
@@ -6402,7 +6393,7 @@ radv_pipeline_init_extra(struct radv_pipeline *pipeline,
          *vgt_gs_out_prim_type = V_028A6C_RECTLIST;
    }
 
-   if (has_depth_attachment || has_stencil_attachment) {
+   if (radv_pipeline_has_ds_attachments(pCreateInfo)) {
       ds_state->db_render_control |= S_028000_DEPTH_CLEAR_ENABLE(extra->db_depth_clear);
       ds_state->db_render_control |= S_028000_STENCIL_CLEAR_ENABLE(extra->db_stencil_clear);
       ds_state->db_render_control |= S_028000_RESUMMARIZE_ENABLE(extra->resummarize_enable);



More information about the mesa-commit mailing list