Module: Mesa Branch: main Commit: 98d10eed480f16c66b7cd1a28e977715ee4aac94 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=98d10eed480f16c66b7cd1a28e977715ee4aac94
Author: Samuel Pitoiset <[email protected]> Date: Wed Aug 11 13:33:30 2021 +0200 radv: remove unused fast depth-stencil gfx clear path with expclear This has never been used because it requires to know the previous clear values which is not really possible in Vulkan. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12326> --- src/amd/vulkan/radv_constants.h | 2 +- src/amd/vulkan/radv_meta_clear.c | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/amd/vulkan/radv_constants.h b/src/amd/vulkan/radv_constants.h index 327365c91f0..b98d0027f83 100644 --- a/src/amd/vulkan/radv_constants.h +++ b/src/amd/vulkan/radv_constants.h @@ -53,7 +53,7 @@ #define MAX_INLINE_UNIFORM_BLOCK_COUNT 64 #define MAX_BIND_POINTS 3 /* compute + graphics + raytracing */ -#define NUM_DEPTH_CLEAR_PIPELINES 3 +#define NUM_DEPTH_CLEAR_PIPELINES 2 #define NUM_DEPTH_DECOMPRESS_PIPELINES 3 /* diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index fdb1a9f900a..459d43747cf 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -29,7 +29,7 @@ #include "util/format_rgb9e5.h" #include "vk_format.h" -enum { DEPTH_CLEAR_SLOW, DEPTH_CLEAR_FAST_EXPCLEAR, DEPTH_CLEAR_FAST_NO_EXPCLEAR }; +enum { DEPTH_CLEAR_SLOW, DEPTH_CLEAR_FAST }; static void build_color_shaders(struct nir_shader **out_vs, struct nir_shader **out_fs, uint32_t frag_output) @@ -636,11 +636,11 @@ create_depthstencil_pipeline(struct radv_device *device, VkImageAspectFlags aspe if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) { extra.db_depth_clear = index == DEPTH_CLEAR_SLOW ? false : true; - extra.db_depth_disable_expclear = index == DEPTH_CLEAR_FAST_NO_EXPCLEAR ? true : false; + extra.db_depth_disable_expclear = index == DEPTH_CLEAR_FAST ? true : false; } if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) { extra.db_stencil_clear = index == DEPTH_CLEAR_SLOW ? false : true; - extra.db_stencil_disable_expclear = index == DEPTH_CLEAR_FAST_NO_EXPCLEAR ? true : false; + extra.db_stencil_disable_expclear = index == DEPTH_CLEAR_FAST ? true : false; } result = create_pipeline(device, radv_render_pass_from_handle(render_pass), samples, vs_nir, fs_nir, @@ -688,15 +688,9 @@ pick_depthstencil_pipeline(struct radv_cmd_buffer *cmd_buffer, struct radv_meta_ bool fast = depth_view_can_fast_clear(cmd_buffer, iview, aspects, layout, in_render_loop, clear_rect, clear_value); bool unrestricted = cmd_buffer->device->vk.enabled_extensions.EXT_depth_range_unrestricted; - int index = DEPTH_CLEAR_SLOW; + int index = fast ? DEPTH_CLEAR_FAST : DEPTH_CLEAR_SLOW; VkPipeline *pipeline; - if (fast) { - /* we don't know the previous clear values, so we always have - * the NO_EXPCLEAR path */ - index = DEPTH_CLEAR_FAST_NO_EXPCLEAR; - } - switch (aspects) { case VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT: pipeline = unrestricted
