From 55ee5329328c15458ebee848cc6b4c9407d50f08 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 3 Oct 2017 14:23:48 +0200 Subject: [PATCH] radv: convert all GFX operations to the RADV_META_SAVE_XXX flags Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_meta_blit.c | 5 ++++- src/amd/vulkan/radv_meta_clear.c | 20 ++++++++++++++++---- src/amd/vulkan/radv_meta_copy.c | 11 +++++++++-- src/amd/vulkan/radv_meta_decompress.c | 3 ++- src/amd/vulkan/radv_meta_fast_clear.c | 3 ++- src/amd/vulkan/radv_meta_resolve.c | 6 ++++-- src/amd/vulkan/radv_meta_resolve_fs.c | 11 +++++++++-- 7 files changed, 46 insertions(+), 13 deletions(-) diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c index 7a863fa9054..83424a50ccd 100644 --- a/src/amd/vulkan/radv_meta_blit.c +++ b/src/amd/vulkan/radv_meta_blit.c @@ -510,7 +510,10 @@ void radv_CmdBlitImage( assert(src_image->info.samples == 1); assert(dest_image->info.samples == 1); - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (unsigned r = 0; r < regionCount; r++) { const VkImageSubresourceLayers *src_res = &pRegions[r].srcSubresource; diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index 435b104f347..734d75a5f75 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -1145,7 +1145,10 @@ radv_cmd_buffer_clear_subpass(struct radv_cmd_buffer *cmd_buffer) if (!radv_subpass_needs_clear(cmd_buffer)) return; - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS); + for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) { uint32_t a = cmd_state->subpass->color_attachments[i].attachment; @@ -1387,7 +1390,10 @@ void radv_CmdClearColorImage( if (cs) radv_meta_save_compute(&saved_state.compute, cmd_buffer, 16); else - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS); + radv_cmd_clear_image(cmd_buffer, image, imageLayout, (const VkClearValue *) pColor, @@ -1411,7 +1417,10 @@ void radv_CmdClearDepthStencilImage( RADV_FROM_HANDLE(radv_image, image, image_h); struct radv_meta_saved_state saved_state; - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS); + radv_cmd_clear_image(cmd_buffer, image, imageLayout, (const VkClearValue *) pDepthStencil, @@ -1435,7 +1444,10 @@ void radv_CmdClearAttachments( if (!cmd_buffer->state.subpass) return; - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS); + /* FINISHME: We can do better than this dumb loop. It thrashes too much * state. diff --git a/src/amd/vulkan/radv_meta_copy.c b/src/amd/vulkan/radv_meta_copy.c index b5a14f6d9fb..d7f521b7472 100644 --- a/src/amd/vulkan/radv_meta_copy.c +++ b/src/amd/vulkan/radv_meta_copy.c @@ -123,7 +123,10 @@ meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer, if (cs) radv_meta_save_compute(&saved_state.compute, cmd_buffer, 12); else - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (unsigned r = 0; r < regionCount; r++) { @@ -342,7 +345,11 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer, if (cs) radv_meta_save_compute(&saved_state.compute, cmd_buffer, 16); else - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); + for (unsigned r = 0; r < regionCount; r++) { assert(pRegions[r].srcSubresource.aspectMask == diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c index e14ea908f8a..2a5459da06e 100644 --- a/src/amd/vulkan/radv_meta_decompress.c +++ b/src/amd/vulkan/radv_meta_decompress.c @@ -317,7 +317,8 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, return; radv_meta_save_pass(&saved_pass_state, cmd_buffer); - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE); switch (op) { case DEPTH_DECOMPRESS: diff --git a/src/amd/vulkan/radv_meta_fast_clear.c b/src/amd/vulkan/radv_meta_fast_clear.c index 04f5d5fb759..b903135b632 100644 --- a/src/amd/vulkan/radv_meta_fast_clear.c +++ b/src/amd/vulkan/radv_meta_fast_clear.c @@ -344,7 +344,8 @@ radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer, assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL); radv_meta_save_pass(&saved_pass_state, cmd_buffer); - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE); if (image->fmask.size > 0) { pipeline = cmd_buffer->device->meta_state.fast_clear_flush.fmask_decompress_pipeline; diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index 14013365e4b..0a9f2c5820b 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -365,7 +365,8 @@ void radv_CmdResolveImage( return; } - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE); assert(src_image->info.samples > 1); if (src_image->info.samples <= 1) { @@ -573,7 +574,8 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer) return; } - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE); for (uint32_t i = 0; i < subpass->color_count; ++i) { VkAttachmentReference src_att = subpass->color_attachments[i]; diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c index 135b539c7a6..152e2265420 100644 --- a/src/amd/vulkan/radv_meta_resolve_fs.c +++ b/src/amd/vulkan/radv_meta_resolve_fs.c @@ -468,7 +468,10 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer, } rp = device->meta_state.resolve_fragment.rc[samples_log2].render_pass[fs_key]; - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (uint32_t r = 0; r < region_count; ++r) { const VkImageResolve *region = ®ions[r]; @@ -595,7 +598,11 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer) if (!subpass->has_resolve) return; - radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0); + radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, + RADV_META_SAVE_GRAPHICS_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); + for (uint32_t i = 0; i < subpass->color_count; ++i) { VkAttachmentReference src_att = subpass->color_attachments[i]; -- 2.30.2