[Mesa-dev] [PATCH] radv: handle VK_QUEUE_FAMILY_IGNORED in image transitions

Dave Airlie airlied at gmail.com
Tue Jan 31 05:24:52 UTC 2017


From: Dave Airlie <airlied at redhat.com>

The CTS tests at least are using this, and we were totally
ignoring it.

This hopefully fixes the bouncing multisample CTS tests.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_cmd_buffer.c |  8 ++++----
 src/amd/vulkan/radv_image.c      | 13 ++++++++++---
 src/amd/vulkan/radv_private.h    |  2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 7dd4aeb..3785020 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -38,8 +38,8 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
 					 struct radv_image *image,
 					 VkImageLayout src_layout,
 					 VkImageLayout dst_layout,
-					 int src_family,
-					 int dst_family,
+					 uint32_t src_family,
+					 uint32_t dst_family,
 					 VkImageSubresourceRange range,
 					 VkImageAspectFlags pending_clears);
 
@@ -2746,8 +2746,8 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
 					 struct radv_image *image,
 					 VkImageLayout src_layout,
 					 VkImageLayout dst_layout,
-					 int src_family,
-					 int dst_family,
+					 uint32_t src_family,
+					 uint32_t dst_family,
 					 VkImageSubresourceRange range,
 					 VkImageAspectFlags pending_clears)
 {
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index f75f008..0d02772 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -900,12 +900,19 @@ bool radv_layout_can_fast_clear(const struct radv_image *image,
 			        VkImageLayout layout,
 			        unsigned queue_mask)
 {
-	return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
-		queue_mask == (1u << RADV_QUEUE_GENERAL);
+	if (layout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
+		return false;
+	if (queue_mask != VK_QUEUE_FAMILY_IGNORED) {
+		if (queue_mask != (1u << RADV_QUEUE_GENERAL))
+			return false;
+	}
+	return true;
 }
 
 
-unsigned radv_image_queue_family_mask(const struct radv_image *image, int family) {
+unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t family) {
+	if (family == VK_QUEUE_FAMILY_IGNORED)
+		return VK_QUEUE_FAMILY_IGNORED;
 	if (image->exclusive)
 		return 1u <<family;
 	return image->queue_family_mask;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 1f25af2..38f60f2 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1088,7 +1088,7 @@ bool radv_layout_can_fast_clear(const struct radv_image *image,
 			        unsigned queue_mask);
 
 
-unsigned radv_image_queue_family_mask(const struct radv_image *image, int family);
+unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t family);
 
 static inline uint32_t
 radv_get_layerCount(const struct radv_image *image,
-- 
2.9.3



More information about the mesa-dev mailing list