[Mesa-dev] [PATCH 08/19] radv: remove the resummarize decompress depth state

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Oct 1 21:50:42 UTC 2017


I'd like to keep this due to potential use for fixing the htile bugs.

See e.g. https://bugs.freedesktop.org/show_bug.cgi?id=102488

On Fri, Sep 29, 2017 at 5:48 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> It's unused.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_meta.h            |  3 --
>  src/amd/vulkan/radv_meta_decompress.c | 69 +++++------------------------------
>  src/amd/vulkan/radv_pipeline.c        |  1 -
>  src/amd/vulkan/radv_private.h         |  2 -
>  4 files changed, 10 insertions(+), 65 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_meta.h b/src/amd/vulkan/radv_meta.h
> index 20b4498ab3..f0685d6e34 100644
> --- a/src/amd/vulkan/radv_meta.h
> +++ b/src/amd/vulkan/radv_meta.h
> @@ -176,9 +176,6 @@ void radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
>  void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>                                          struct radv_image *image,
>                                          VkImageSubresourceRange *subresourceRange);
> -void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
> -                                         struct radv_image *image,
> -                                         VkImageSubresourceRange *subresourceRange);
>  void radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>                                          struct radv_image *image,
>                                          const VkImageSubresourceRange *subresourceRange);
> diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
> index 23bc2e6dfd..fedcfad3ae 100644
> --- a/src/amd/vulkan/radv_meta_decompress.c
> +++ b/src/amd/vulkan/radv_meta_decompress.c
> @@ -80,8 +80,7 @@ create_pipeline(struct radv_device *device,
>                  VkShaderModule vs_module_h,
>                 uint32_t samples,
>                 VkRenderPass pass,
> -               VkPipeline *decompress_pipeline,
> -               VkPipeline *resummarize_pipeline)
> +               VkPipeline *decompress_pipeline)
>  {
>         VkResult result;
>         VkDevice device_h = radv_device_to_handle(device);
> @@ -182,20 +181,6 @@ create_pipeline(struct radv_device *device,
>         if (result != VK_SUCCESS)
>                 goto cleanup;
>
> -       result = radv_graphics_pipeline_create(device_h,
> -                                              radv_pipeline_cache_to_handle(&device->meta_state.cache),
> -                                              &pipeline_create_info,
> -                                              &(struct radv_graphics_pipeline_create_info) {
> -                                                       .use_rectlist = true,
> -                                                       .db_flush_depth_inplace = true,
> -                                                       .db_flush_stencil_inplace = true,
> -                                                       .db_resummarize = true,
> -                                              },
> -                                              &device->meta_state.alloc,
> -                                              resummarize_pipeline);
> -       if (result != VK_SUCCESS)
> -               goto cleanup;
> -
>         goto cleanup;
>
>  cleanup:
> @@ -219,10 +204,6 @@ radv_device_finish_meta_depth_decomp_state(struct radv_device *device)
>                 if (pipeline_h) {
>                         radv_DestroyPipeline(device_h, pipeline_h, alloc);
>                 }
> -               pipeline_h = state->depth_decomp[i].resummarize_pipeline;
> -               if (pipeline_h) {
> -                       radv_DestroyPipeline(device_h, pipeline_h, alloc);
> -               }
>         }
>  }
>
> @@ -250,8 +231,7 @@ radv_device_init_meta_depth_decomp_state(struct radv_device *device)
>
>                 res = create_pipeline(device, vs_module_h, samples,
>                                       state->depth_decomp[i].pass,
> -                                     &state->depth_decomp[i].decompress_pipeline,
> -                                     &state->depth_decomp[i].resummarize_pipeline);
> +                                     &state->depth_decomp[i].decompress_pipeline);
>                 if (res != VK_SUCCESS)
>                         goto fail;
>         }
> @@ -299,16 +279,10 @@ emit_depth_decomp(struct radv_cmd_buffer *cmd_buffer,
>         radv_CmdDraw(cmd_buffer_h, 3, 1, 0, 0);
>  }
>
> -
> -enum radv_depth_op {
> -       DEPTH_DECOMPRESS,
> -       DEPTH_RESUMMARIZE,
> -};
> -
> -static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
> -                                            struct radv_image *image,
> -                                            VkImageSubresourceRange *subresourceRange,
> -                                            enum radv_depth_op op)
> +void
> +radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
> +                                   struct radv_image *image,
> +                                   VkImageSubresourceRange *subresourceRange)
>  {
>         struct radv_meta_saved_state saved_state;
>         struct radv_meta_saved_pass_state saved_pass_state;
> @@ -322,6 +296,8 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>         uint32_t samples_log2 = ffs(samples) - 1;
>         struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state;
>
> +       assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
> +
>         if (!image->surface.htile_size)
>                 return;
>         radv_meta_save_pass(&saved_pass_state, cmd_buffer);
> @@ -382,17 +358,8 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>                                            },
>                                            VK_SUBPASS_CONTENTS_INLINE);
>
> -               VkPipeline pipeline_h;
> -               switch (op) {
> -               case DEPTH_DECOMPRESS:
> -                       pipeline_h = meta_state->depth_decomp[samples_log2].decompress_pipeline;
> -                       break;
> -               case DEPTH_RESUMMARIZE:
> -                       pipeline_h = meta_state->depth_decomp[samples_log2].resummarize_pipeline;
> -                       break;
> -               default:
> -                       unreachable("unknown operation");
> -               }
> +               VkPipeline pipeline_h =
> +                       meta_state->depth_decomp[samples_log2].decompress_pipeline;
>
>                 emit_depth_decomp(cmd_buffer, &(VkOffset2D){0, 0 }, &(VkExtent2D){width, height}, pipeline_h);
>                 radv_CmdEndRenderPass(cmd_buffer_h);
> @@ -403,19 +370,3 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>         radv_meta_restore(&saved_state, cmd_buffer);
>         radv_meta_restore_pass(&saved_pass_state, cmd_buffer);
>  }
> -
> -void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
> -                                        struct radv_image *image,
> -                                        VkImageSubresourceRange *subresourceRange)
> -{
> -       assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
> -       radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange, DEPTH_DECOMPRESS);
> -}
> -
> -void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
> -                                        struct radv_image *image,
> -                                        VkImageSubresourceRange *subresourceRange)
> -{
> -       assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
> -       radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange, DEPTH_RESUMMARIZE);
> -}
> diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
> index 228fdf4ab0..808c41d1b9 100644
> --- a/src/amd/vulkan/radv_pipeline.c
> +++ b/src/amd/vulkan/radv_pipeline.c
> @@ -971,7 +971,6 @@ radv_pipeline_init_depth_stencil_state(struct radv_pipeline *pipeline,
>                 ds->db_render_control |= S_028000_DEPTH_CLEAR_ENABLE(extra->db_depth_clear);
>                 ds->db_render_control |= S_028000_STENCIL_CLEAR_ENABLE(extra->db_stencil_clear);
>
> -               ds->db_render_control |= S_028000_RESUMMARIZE_ENABLE(extra->db_resummarize);
>                 ds->db_render_control |= S_028000_DEPTH_COMPRESS_DISABLE(extra->db_flush_depth_inplace);
>                 ds->db_render_control |= S_028000_STENCIL_COMPRESS_DISABLE(extra->db_flush_stencil_inplace);
>                 ds->db_render_override2 |= S_028010_DISABLE_ZMASK_EXPCLEAR_OPTIMIZATION(extra->db_depth_disable_expclear);
> diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
> index 93898a6ad1..f292709805 100644
> --- a/src/amd/vulkan/radv_private.h
> +++ b/src/amd/vulkan/radv_private.h
> @@ -439,7 +439,6 @@ struct radv_meta_state {
>
>         struct {
>                 VkPipeline                                decompress_pipeline;
> -               VkPipeline                                resummarize_pipeline;
>                 VkRenderPass                              pass;
>         } depth_decomp[1 + MAX_SAMPLES_LOG2];
>
> @@ -1134,7 +1133,6 @@ struct radv_graphics_pipeline_create_info {
>         bool db_stencil_disable_expclear;
>         bool db_flush_depth_inplace;
>         bool db_flush_stencil_inplace;
> -       bool db_resummarize;
>         uint32_t custom_blend_mode;
>  };
>
> --
> 2.14.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list