[Mesa-dev] [PATCH] radv: handle image transitions for fmasks

Dave Airlie airlied at gmail.com
Thu Oct 20 02:07:03 UTC 2016


From: Dave Airlie <airlied at redhat.com>

This fixes
dEQP-VK.pipeline.multisample.sampled_image*

These all render to multisampled image, and then
sample from it, so we must transition it correctly.

Cc: "13.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_cmd_buffer.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 3f1a6f4..64a87ac 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -2170,6 +2170,21 @@ static void radv_handle_cmask_image_transition(struct radv_cmd_buffer *cmd_buffe
 	}
 }
 
+static void radv_handle_fmask_image_transition(struct radv_cmd_buffer *cmd_buffer,
+					       struct radv_image *image,
+					       VkImageLayout src_layout,
+					       VkImageLayout dst_layout,
+					       VkImageSubresourceRange range,
+					       VkImageAspectFlags pending_clears)
+{
+	/* fmask should be same conditions as cmask */
+	if (radv_layout_has_cmask(image, src_layout) &&
+	    !radv_layout_has_cmask(image, dst_layout)) {
+
+		radv_fast_clear_flush_image_inplace(cmd_buffer, image);
+	}
+}
+
 void radv_initialize_dcc(struct radv_cmd_buffer *cmd_buffer,
 			 struct radv_image *image, uint32_t value)
 {
@@ -2217,6 +2232,10 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
 		radv_handle_cmask_image_transition(cmd_buffer, image, src_layout,
 						   dst_layout, range, pending_clears);
 
+	if (image->fmask.size)
+		radv_handle_fmask_image_transition(cmd_buffer, image, src_layout,
+						   dst_layout, range, pending_clears);
+
 	if (image->surface.dcc_size)
 		radv_handle_dcc_image_transition(cmd_buffer, image, src_layout,
 						 dst_layout, range, pending_clears);
-- 
2.5.5



More information about the mesa-dev mailing list