[Mesa-dev] [PATCH 06/10] radv: convert all GFX operations to the RADV_META_SAVE_XXX flags

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Oct 3 18:52:41 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 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 eb43b822e3..55f9a8807b 100644
--- a/src/amd/vulkan/radv_meta_blit.c
+++ b/src/amd/vulkan/radv_meta_blit.c
@@ -512,7 +512,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 |
+							     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 47aef2098a..1d137d3303 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1139,7 +1139,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 |
+							     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;
@@ -1381,7 +1384,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 |
+								     RADV_META_SAVE_CONSTANTS);
+
 
 	radv_cmd_clear_image(cmd_buffer, image, imageLayout,
 			     (const VkClearValue *) pColor,
@@ -1405,7 +1411,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 |
+							     RADV_META_SAVE_CONSTANTS);
+
 
 	radv_cmd_clear_image(cmd_buffer, image, imageLayout,
 			     (const VkClearValue *) pDepthStencil,
@@ -1429,7 +1438,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 |
+							     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 b5a14f6d9f..5272a3af4b 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 |
+								     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 |
+								     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 ba2133fabe..3edc1be2f0 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -321,7 +321,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);
 
 	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 7daa2ad015..c1f42205fb 100644
--- a/src/amd/vulkan/radv_meta_fast_clear.c
+++ b/src/amd/vulkan/radv_meta_fast_clear.c
@@ -346,7 +346,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);
 
 	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 b9020adcb6..455a8f389c 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -370,7 +370,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);
 
 	assert(src_image->info.samples > 1);
 	if (src_image->info.samples <= 1) {
@@ -578,7 +579,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);
 
 	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 c0c1ff4b6e..3b633f6e5d 100644
--- a/src/amd/vulkan/radv_meta_resolve_fs.c
+++ b/src/amd/vulkan/radv_meta_resolve_fs.c
@@ -471,7 +471,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 |
+							     RADV_META_SAVE_CONSTANTS |
+							     RADV_META_SAVE_DESCRIPTORS);
 
 	for (uint32_t r = 0; r < region_count; ++r) {
 		const VkImageResolve *region = &regions[r];
@@ -598,7 +601,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 |
+							     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.14.2



More information about the mesa-dev mailing list