From 1d82ec1b3f995adc66457b7bcf0ca34cbb9de8db Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 31 May 2022 08:47:19 +0200 Subject: [PATCH] radv: remove RADV_META_SAVE_SAMPLE_LOCATIONS We already save/restore all other dynamic states unconditionally, it's not really useful to make an exception for sample locations. Signed-off-by: Samuel Pitoiset Reviewed-By: Mike Blumenkrantz Part-of: --- src/amd/vulkan/radv_meta.c | 15 +++++---------- src/amd/vulkan/radv_meta.h | 3 +-- src/amd/vulkan/radv_meta_decompress.c | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index e98d3d7463c..90b47bc1ee3 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -183,9 +183,7 @@ radv_meta_save(struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_ typed_memcpy(state->dynamic.discard_rectangle.rectangles, cmd_buffer->state.dynamic.discard_rectangle.rectangles, MAX_DISCARD_RECTANGLES); - } - if (state->flags & RADV_META_SAVE_SAMPLE_LOCATIONS) { typed_memcpy(&state->dynamic.sample_location, &cmd_buffer->state.dynamic.sample_location, 1); } @@ -314,6 +312,9 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf state->dynamic.discard_rectangle.rectangles, MAX_DISCARD_RECTANGLES); + typed_memcpy(&cmd_buffer->state.dynamic.sample_location.locations, + &state->dynamic.sample_location.locations, 1); + cmd_buffer->state.dirty |= RADV_CMD_DIRTY_DYNAMIC_VIEWPORT | RADV_CMD_DIRTY_DYNAMIC_SCISSOR | RADV_CMD_DIRTY_DYNAMIC_CULL_MODE | RADV_CMD_DIRTY_DYNAMIC_FRONT_FACE | @@ -328,14 +329,8 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf RADV_CMD_DIRTY_DYNAMIC_COLOR_WRITE_ENABLE | RADV_CMD_DIRTY_DYNAMIC_LINE_STIPPLE | RADV_CMD_DIRTY_DYNAMIC_STENCIL_COMPARE_MASK | RADV_CMD_DIRTY_DYNAMIC_DEPTH_BOUNDS | RADV_CMD_DIRTY_DYNAMIC_BLEND_CONSTANTS | RADV_CMD_DIRTY_DYNAMIC_LINE_WIDTH | - RADV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS | RADV_CMD_DIRTY_DYNAMIC_DISCARD_RECTANGLE; - } - - if (state->flags & RADV_META_SAVE_SAMPLE_LOCATIONS) { - typed_memcpy(&cmd_buffer->state.dynamic.sample_location.locations, - &state->dynamic.sample_location.locations, 1); - - cmd_buffer->state.dirty |= RADV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS; + RADV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS | RADV_CMD_DIRTY_DYNAMIC_DISCARD_RECTANGLE | + RADV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS; } if (state->flags & RADV_META_SAVE_COMPUTE_PIPELINE) { diff --git a/src/amd/vulkan/radv_meta.h b/src/amd/vulkan/radv_meta.h index 039e64b0bec..ef7e2edbb3c 100644 --- a/src/amd/vulkan/radv_meta.h +++ b/src/amd/vulkan/radv_meta.h @@ -39,8 +39,7 @@ enum radv_meta_save_flags { RADV_META_SAVE_DESCRIPTORS = (1 << 2), RADV_META_SAVE_GRAPHICS_PIPELINE = (1 << 3), RADV_META_SAVE_COMPUTE_PIPELINE = (1 << 4), - RADV_META_SAVE_SAMPLE_LOCATIONS = (1 << 5), - RADV_META_SUSPEND_PREDICATING = (1 << 6), + RADV_META_SUSPEND_PREDICATING = (1 << 5), }; struct radv_meta_saved_state { diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c index d72346e8239..ea8241a7c10 100644 --- a/src/amd/vulkan/radv_meta_decompress.c +++ b/src/amd/vulkan/radv_meta_decompress.c @@ -470,7 +470,7 @@ radv_process_depth_stencil(struct radv_cmd_buffer *cmd_buffer, struct radv_image radv_meta_save( &saved_state, cmd_buffer, - RADV_META_SAVE_GRAPHICS_PIPELINE | RADV_META_SAVE_SAMPLE_LOCATIONS | RADV_META_SAVE_PASS); + RADV_META_SAVE_GRAPHICS_PIPELINE | RADV_META_SAVE_PASS); pipeline = radv_get_depth_pipeline(cmd_buffer, image, subresourceRange, op);