tests: Add barrier queue family index tests
authorJohn Zulauf <jzulauf@lunarg.com>
Tue, 16 Jan 2018 18:48:49 +0000 (11:48 -0700)
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>
Tue, 23 Jan 2018 18:07:07 +0000 (11:07 -0700)
Add validation layer tests for Buffer and Image memory barriers.

VUIDs test refactored(*)/new:
VALIDATION_ERROR_0a000960*   VUID-VkImageMemoryBarrier-image-01200
VALIDATION_ERROR_0a000962    VUID-VkImageMemoryBarrier-image-01201
VALIDATION_ERROR_0a00096a    VUID-VkImageMemoryBarrier-image-01205
VALIDATION_ERROR_0a000dce    VUID-VkImageMemoryBarrier-image-01767
VALIDATION_ERROR_0a000dd0    VUID-VkImageMemoryBarrier-image-01768
VALIDATION_ERROR_0a00095e    VUID-VkImageMemoryBarrier-image-01199
VALIDATION_ERROR_0a000aca    VUID-VkImageMemoryBarrier-image-01381
VALIDATION_ERROR_0a000dcc    VUID-VkImageMemoryBarrier-image-01766

VALIDATION_ERROR_0180094e    VUID-VkBufferMemoryBarrier-buffer-01191
VALIDATION_ERROR_01800dc6    VUID-VkBufferMemoryBarrier-buffer-01763
VALIDATION_ERROR_01800952    VUID-VkBufferMemoryBarrier-buffer-01193
VALIDATION_ERROR_01800dca    VUID-VkBufferMemoryBarrier-buffer-01765
VALIDATION_ERROR_01800dc8    VUID-VkBufferMemoryBarrier-buffer-01764
VALIDATION_ERROR_0180094c    VUID-VkBufferMemoryBarrier-buffer-01190
VALIDATION_ERROR_01800950    VUID-VkBufferMemoryBarrier-buffer-01192
VALIDATION_ERROR_01800958    VUID-VkBufferMemoryBarrier-buffer-01196

Change-Id: Icf5d7f1ddbeeab90324cfb034648813741a65398

layers/vk_validation_error_database.txt
tests/layer_validation_tests.cpp

index f45a963..4143dd9 100644 (file)
@@ -183,17 +183,17 @@ VALIDATION_ERROR_0160aa01~^~N~^~Unknown~^~vkCmdCopyImageToBuffer~^~VUID-VkBuffer
 VALIDATION_ERROR_01800946~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-offset-01187~^~core~^~The spec valid usage text states 'offset must be less than the size of buffer' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-offset-01187)~^~
 VALIDATION_ERROR_01800948~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01188~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01188)~^~
 VALIDATION_ERROR_0180094a~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-size-01189~^~core~^~The spec valid usage text states 'If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-size-01189)~^~
-VALIDATION_ERROR_0180094c~^~Y~^~None~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01190~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)~^~
-VALIDATION_ERROR_0180094e~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01191~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)~^~
-VALIDATION_ERROR_01800950~^~Y~^~None~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01192~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)~^~
-VALIDATION_ERROR_01800952~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01193~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01193)~^~
+VALIDATION_ERROR_0180094c~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01190~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01190)~^~
+VALIDATION_ERROR_0180094e~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01191~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01191)~^~
+VALIDATION_ERROR_01800950~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01192~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01192)~^~
+VALIDATION_ERROR_01800952~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01193~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01193)~^~
 VALIDATION_ERROR_01800954~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01194~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01194)~^~
 VALIDATION_ERROR_01800956~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01195~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties)' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01195)~^~
-VALIDATION_ERROR_01800958~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01196~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01196)~^~
+VALIDATION_ERROR_01800958~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01196~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01196)~^~
 VALIDATION_ERROR_01800ac8~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01380~^~core~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01380)~^~
-VALIDATION_ERROR_01800dc6~^~Y~^~None~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01763~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01763)~^~
-VALIDATION_ERROR_01800dc8~^~Y~^~None~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01764~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01764)~^~
-VALIDATION_ERROR_01800dca~^~Y~^~None~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01765~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01765)~^~
+VALIDATION_ERROR_01800dc6~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01763~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01763)~^~
+VALIDATION_ERROR_01800dc8~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01764~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01764)~^~
+VALIDATION_ERROR_01800dca~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkBufferMemoryBarrier~^~VUID-VkBufferMemoryBarrier-buffer-01765~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If buffer was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-01765)~^~
 VALIDATION_ERROR_01801a01~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-buffer-parameter~^~core~^~The spec valid usage text states 'buffer must be a valid VkBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-buffer-parameter)~^~implicit
 VALIDATION_ERROR_01806801~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-dstAccessMask-parameter~^~core~^~The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-dstAccessMask-parameter)~^~implicit
 VALIDATION_ERROR_0181c40d~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkBufferMemoryBarrier-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkBufferMemoryBarrier-pNext-pNext)~^~implicit, TBD in parameter validation layer.
@@ -768,12 +768,12 @@ VALIDATION_ERROR_09e30601~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo
 VALIDATION_ERROR_09e30603~^~Y~^~Unknown~^~vkCreateImage~^~VUID-VkImageCreateInfo-usage-requiredbitmask~^~core~^~The spec valid usage text states 'usage must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-usage-requiredbitmask)~^~implicit
 VALIDATION_ERROR_0a00095a~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01197~^~core~^~The spec valid usage text states 'oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01197)~^~
 VALIDATION_ERROR_0a00095c~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-newLayout-01198~^~core~^~The spec valid usage text states 'newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-01198)~^~
-VALIDATION_ERROR_0a00095e~^~Y~^~None~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01199~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01199)~^~
-VALIDATION_ERROR_0a000960~^~Y~^~InvalidQueueIndexInvalidQuery~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01200~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01200)~^~
-VALIDATION_ERROR_0a000962~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01201~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01201)~^~
+VALIDATION_ERROR_0a00095e~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01199~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01199)~^~
+VALIDATION_ERROR_0a000960~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01200~^~!(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01200)~^~
+VALIDATION_ERROR_0a000962~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01201~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, dstQueueFamilyIndex must also be VK_QUEUE_FAMILY_IGNORED.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01201)~^~
 VALIDATION_ERROR_0a000964~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01202~^~core~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01202)~^~
 VALIDATION_ERROR_0a000966~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01203~^~core~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or VK_QUEUE_FAMILY_EXTERNAL_KHR (see Queue Family Properties).' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01203)~^~
-VALIDATION_ERROR_0a00096a~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01205~^~core~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01205)~^~
+VALIDATION_ERROR_0a00096a~^~Y~^~InvalidBarrierQueueFamily~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01205~^~core~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not VK_QUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01205)~^~
 VALIDATION_ERROR_0a00096c~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-subresourceRange-01206~^~core~^~The spec valid usage text states 'subresourceRange must be a valid image subresource range for the image (see Image Views)' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01206)~^~
 VALIDATION_ERROR_0a00096e~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01207~^~core~^~The spec valid usage text states 'If image has a depth/stencil format with both depth and stencil components, then the aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01207)~^~
 VALIDATION_ERROR_0a000970~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01208~^~core~^~The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01208)~^~
@@ -782,7 +782,7 @@ VALIDATION_ERROR_0a000974~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-Vk
 VALIDATION_ERROR_0a000976~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01211~^~core~^~The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01211)~^~
 VALIDATION_ERROR_0a000978~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01212~^~core~^~The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01212)~^~
 VALIDATION_ERROR_0a00097a~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-oldLayout-01213~^~core~^~The spec valid usage text states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01213)~^~
-VALIDATION_ERROR_0a000aca~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01381~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01381)~^~
+VALIDATION_ERROR_0a000aca~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01381~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01381)~^~
 VALIDATION_ERROR_0a000acc~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-01382~^~core~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01382)~^~
 VALIDATION_ERROR_0a000b9c~^~Y~^~ImageBarrierWithBadRange~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-subresourceRange-01486~^~core~^~The spec valid usage text states 'subresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01486)~^~
 VALIDATION_ERROR_0a000b9e~^~Y~^~ImageBarrierWithBadRange~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-subresourceRange-01487~^~core~^~The spec valid usage text states 'If subresourceRange::levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange::levelCount must be non-zero and subresourceRange::baseMipLevel + subresourceRange::levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01487)~^~
@@ -795,9 +795,9 @@ VALIDATION_ERROR_0a000d10~^~N~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemory
 VALIDATION_ERROR_0a000d12~^~N~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01673~^~(VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If image has a multi-planar format with only two planes, then the aspectMask member of subresourceRange must not include VK_IMAGE_ASPECT_PLANE_2_BIT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01673)~^~
 VALIDATION_ERROR_0a000d78~^~N~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-subresourceRange-01724~^~core~^~The spec valid usage text states 'If subresourceRange.levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01724)~^~
 VALIDATION_ERROR_0a000d7a~^~N~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-subresourceRange-01725~^~core~^~The spec valid usage text states 'If subresourceRange.layerCount is not VK_REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-subresourceRange-01725)~^~
-VALIDATION_ERROR_0a000dcc~^~Y~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01766~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01766)~^~
-VALIDATION_ERROR_0a000dce~^~Y~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01767~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01767)~^~
-VALIDATION_ERROR_0a000dd0~^~Y~^~None~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01768~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01768)~^~
+VALIDATION_ERROR_0a000dcc~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01766~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is VK_QUEUE_FAMILY_IGNORED, the other must be VK_QUEUE_FAMILY_IGNORED or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01766)~^~
+VALIDATION_ERROR_0a000dce~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01767~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and srcQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01767)~^~
+VALIDATION_ERROR_0a000dd0~^~Y~^~InvalidBarrierQueueFamilyWithMemExt~^~VkImageMemoryBarrier~^~VUID-VkImageMemoryBarrier-image-01768~^~(VK_KHR_external_memory)~^~The spec valid usage text states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE and dstQueueFamilyIndex is not VK_QUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-image-01768)~^~
 VALIDATION_ERROR_0a006801~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-dstAccessMask-parameter~^~core~^~The spec valid usage text states 'dstAccessMask must be a valid combination of VkAccessFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-dstAccessMask-parameter)~^~implicit
 VALIDATION_ERROR_0a00a001~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-image-parameter~^~core~^~The spec valid usage text states 'image must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-image-parameter)~^~implicit
 VALIDATION_ERROR_0a00d401~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-VkImageMemoryBarrier-newLayout-parameter~^~core~^~The spec valid usage text states 'newLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-parameter)~^~implicit
index 8cc89f0..a5e64f7 100644 (file)
@@ -427,6 +427,7 @@ class VkLayerTest : public VkRenderFramework {
 
    public:
     ErrorMonitor *Monitor() { return m_errorMonitor; }
+    VkCommandBufferObj *CommandBuffer() { return m_commandBuffer; }
 
    protected:
     bool m_enableWSI;
@@ -11717,6 +11718,185 @@ TEST_F(VkLayerTest, InvalidBarriers) {
     bad_command_buffer.end();
 }
 
+class BarrierQueueFamilyTestHelper {
+   public:
+    BarrierQueueFamilyTestHelper(VkLayerTest &test) : layer_test_(test), image_(test.DeviceObj()) {}
+    // Init with queue familes non-null for CONCURRENT sharing mode (which requires them)
+    void Init(std::vector<uint32_t> *families) {
+        VkDeviceObj *device_obj = layer_test_.DeviceObj();
+        image_.Init(32, 32, 1, VK_FORMAT_B8G8R8A8_UNORM, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_TILING_OPTIMAL, 0, families);
+        ASSERT_TRUE(image_.initialized());
+
+        image_barrier_ =
+            image_.image_memory_barrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, image_.Layout(),
+                                        image_.Layout(), image_.subresource_range(VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1));
+
+        VkMemoryPropertyFlags mem_prop = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+        buffer_.init_as_src_and_dst(*device_obj, 256, mem_prop, families);
+        ASSERT_TRUE(buffer_.initialized());
+        buffer_barrier_ =
+            buffer_.buffer_memory_barrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, 0, VK_WHOLE_SIZE);
+    }
+
+    void operator()(UNIQUE_VALIDATION_ERROR_CODE img_err, UNIQUE_VALIDATION_ERROR_CODE buf_err, uint32_t src, uint32_t dst,
+                    bool positive = false, VkQueue submit = VK_NULL_HANDLE) {
+        auto monitor = layer_test_.Monitor();
+        monitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, img_err);
+        monitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, buf_err);
+
+        layer_test_.CommandBuffer()->begin();
+        image_barrier_.srcQueueFamilyIndex = src;
+        image_barrier_.dstQueueFamilyIndex = dst;
+        buffer_barrier_.srcQueueFamilyIndex = src;
+        buffer_barrier_.dstQueueFamilyIndex = dst;
+        vkCmdPipelineBarrier(layer_test_.CommandBuffer()->handle(), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+                             VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_DEPENDENCY_BY_REGION_BIT, 0, nullptr, 1, &buffer_barrier_, 1,
+                             &image_barrier_);
+        layer_test_.CommandBuffer()->end();
+
+        VkCommandBuffer cb_handle = layer_test_.CommandBuffer()->handle();
+        if (submit != VK_NULL_HANDLE) {
+            VkSubmitInfo submit_info = {VK_STRUCTURE_TYPE_SUBMIT_INFO, nullptr, 0, nullptr, nullptr, 1, &cb_handle, 0, nullptr};
+            VkResult err = vkQueueSubmit(submit, 1, &submit_info, VK_NULL_HANDLE);
+            if (positive) {
+                ASSERT_TRUE(err == VK_SUCCESS);
+                err = vkQueueWaitIdle(submit);
+            }
+        }
+        vkResetCommandBuffer(cb_handle, 0);
+
+        if (positive) {
+            monitor->VerifyNotFound();
+        } else {
+            monitor->VerifyFound();
+        }
+    };
+
+   protected:
+    VkLayerTest &layer_test_;
+    VkImageObj image_;
+    VkImageMemoryBarrier image_barrier_;
+    vk_testing::Buffer buffer_;
+    VkBufferMemoryBarrier buffer_barrier_;
+};
+
+TEST_F(VkLayerTest, InvalidBarrierQueueFamily) {
+    TEST_DESCRIPTION("Create and submit barriers with invalid queue families");
+    ASSERT_NO_FATAL_FAILURE(Init(nullptr, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT));
+
+    // Find queues of two families
+    const uint32_t submit_family = m_device->graphics_queue_node_index_;
+    const uint32_t invalid = static_cast<uint32_t>(m_device->queue_props.size());
+    const uint32_t other_family = submit_family != 0 ? 0 : 1;
+    const bool only_one_family = invalid == 1;
+
+    if (only_one_family) {
+        printf("             Single queue family found -- VK_SHARING_MODE_CONCURRENT testcases skipped.\n");
+    } else {
+        std::vector<uint32_t> families = {submit_family, other_family};
+        BarrierQueueFamilyTestHelper conc_test(*this);
+        conc_test.Init(&families);
+        // core_validation::barrier_queue_families::kSrcAndDestMustBeIgnore
+        conc_test(VALIDATION_ERROR_0a00095e, VALIDATION_ERROR_0180094c, VK_QUEUE_FAMILY_IGNORED, submit_family);
+        conc_test(VALIDATION_ERROR_0a00095e, VALIDATION_ERROR_0180094c, submit_family, VK_QUEUE_FAMILY_IGNORED);
+        conc_test(VALIDATION_ERROR_0a00095e, VALIDATION_ERROR_0180094c, submit_family, submit_family);
+        // true -> positive test
+        conc_test(VALIDATION_ERROR_0a00095e, VALIDATION_ERROR_0180094c, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, true);
+    }
+
+    BarrierQueueFamilyTestHelper excl_test(*this);
+    excl_test.Init(nullptr);  // no queue families means *exclusive* sharing mode.
+
+    // core_validation::barrier_queue_families::kBothIgnoreOrBothValid
+    excl_test(VALIDATION_ERROR_0a000960, VALIDATION_ERROR_01800950, VK_QUEUE_FAMILY_IGNORED, submit_family);
+    excl_test(VALIDATION_ERROR_0a000960, VALIDATION_ERROR_01800950, submit_family, VK_QUEUE_FAMILY_IGNORED);
+    // true -> positive test
+    excl_test(VALIDATION_ERROR_0a000960, VALIDATION_ERROR_01800950, submit_family, submit_family, true);
+    excl_test(VALIDATION_ERROR_0a000960, VALIDATION_ERROR_01800950, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, true);
+
+    if (only_one_family) {
+        printf("             Single queue family found -- VK_SHARING_MODE_EXCLUSIVE submit testcases skipped.\n");
+    } else {
+        // core_validation::barrier_queue_families::kSubmitQueueMustMatchSrcOrDst
+        excl_test(VALIDATION_ERROR_0a00096a, VALIDATION_ERROR_01800958, other_family, other_family, false, m_device->m_queue);
+        // true -> positive test
+        // Note: when we start tracking resource onwership, we'll need a way to reset the buffers s.t. this doesn't
+        //       trigger unexpected errors
+        excl_test(VALIDATION_ERROR_0a00096a, VALIDATION_ERROR_01800958, submit_family, other_family, true, m_device->m_queue);
+        excl_test(VALIDATION_ERROR_0a00096a, VALIDATION_ERROR_01800958, other_family, submit_family, true, m_device->m_queue);
+    }
+}
+
+TEST_F(VkLayerTest, InvalidBarrierQueueFamilyWithMemExt) {
+    TEST_DESCRIPTION("Create and submit barriers with invalid queue families when memory extension is enabled ");
+    ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));
+    // Check for external memory device extensions
+    if (DeviceExtensionSupported(gpu(), nullptr, VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME)) {
+        m_device_extension_names.push_back(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
+    } else {
+        printf("             External memory extension not supported, skipping test\n");
+        return;
+    }
+
+    ASSERT_NO_FATAL_FAILURE(InitState(nullptr, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT));
+
+    // Find queues of two families
+    const uint32_t submit_family = m_device->graphics_queue_node_index_;
+    const uint32_t invalid = static_cast<uint32_t>(m_device->queue_props.size());
+    const uint32_t other_family = submit_family != 0 ? 0 : 1;
+    const bool only_one_family = invalid == 1;
+
+    if (only_one_family) {
+        printf("             Single queue family found -- VK_SHARING_MODE_CONCURRENT testcases skipped.\n");
+    } else {
+        std::vector<uint32_t> families = {submit_family, other_family};
+        BarrierQueueFamilyTestHelper conc_test(*this);
+
+        // core_validation::barrier_queue_families::kSrcOrDstMustBeIgnore
+        conc_test.Init(&families);
+        conc_test(VALIDATION_ERROR_0a000aca, VALIDATION_ERROR_0180094e, submit_family, submit_family);
+        // true -> positive test
+        conc_test(VALIDATION_ERROR_0a000aca, VALIDATION_ERROR_0180094e, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, true);
+        conc_test(VALIDATION_ERROR_0a000aca, VALIDATION_ERROR_0180094e, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_EXTERNAL_KHR,
+                  true);
+        conc_test(VALIDATION_ERROR_0a000aca, VALIDATION_ERROR_0180094e, VK_QUEUE_FAMILY_EXTERNAL_KHR, VK_QUEUE_FAMILY_IGNORED,
+                  true);
+
+        // core_validation::barrier_queue_families::kSpecialOrIgnoreOnly
+        conc_test(VALIDATION_ERROR_0a000dcc, VALIDATION_ERROR_01800dc6, submit_family, VK_QUEUE_FAMILY_IGNORED);
+        conc_test(VALIDATION_ERROR_0a000dcc, VALIDATION_ERROR_01800dc6, VK_QUEUE_FAMILY_IGNORED, submit_family);
+        // This is to flag the errors that would be considered only "unexpected" in the parallel case above
+        // true -> positive test
+        conc_test(VALIDATION_ERROR_0a000dcc, VALIDATION_ERROR_01800dc6, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_EXTERNAL_KHR,
+                  true);
+        conc_test(VALIDATION_ERROR_0a000dcc, VALIDATION_ERROR_01800dc6, VK_QUEUE_FAMILY_EXTERNAL_KHR, VK_QUEUE_FAMILY_IGNORED,
+                  true);
+    }
+
+    BarrierQueueFamilyTestHelper excl_test(*this);
+    excl_test.Init(nullptr);  // no queue families means *exclusive* sharing mode.
+
+    // core_validation::barrier_queue_families::kSrcIgnoreRequiresDstIgnore
+    excl_test(VALIDATION_ERROR_0a000962, VALIDATION_ERROR_01800952, VK_QUEUE_FAMILY_IGNORED, submit_family);
+    excl_test(VALIDATION_ERROR_0a000962, VALIDATION_ERROR_01800952, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_EXTERNAL_KHR);
+    // true -> positive test
+    excl_test(VALIDATION_ERROR_0a000962, VALIDATION_ERROR_01800952, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, true);
+
+    // core_validation::barrier_queue_families::kDstValidOrSpecialIfNotIgnore
+    excl_test(VALIDATION_ERROR_0a000dd0, VALIDATION_ERROR_01800dca, submit_family, invalid);
+    // true -> positive test
+    excl_test(VALIDATION_ERROR_0a000dd0, VALIDATION_ERROR_01800dca, submit_family, submit_family, true);
+    excl_test(VALIDATION_ERROR_0a000dd0, VALIDATION_ERROR_01800dca, submit_family, VK_QUEUE_FAMILY_IGNORED, true);
+    excl_test(VALIDATION_ERROR_0a000dd0, VALIDATION_ERROR_01800dca, submit_family, VK_QUEUE_FAMILY_EXTERNAL_KHR, true);
+
+    // core_validation::barrier_queue_families::kSrcValidOrSpecialIfNotIgnore
+    excl_test(VALIDATION_ERROR_0a000dce, VALIDATION_ERROR_01800dc8, invalid, submit_family);
+    // true -> positive test
+    excl_test(VALIDATION_ERROR_0a000dce, VALIDATION_ERROR_01800dc8, submit_family, submit_family, true);
+    excl_test(VALIDATION_ERROR_0a000dce, VALIDATION_ERROR_01800dc8, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, true);
+    excl_test(VALIDATION_ERROR_0a000dce, VALIDATION_ERROR_01800dc8, VK_QUEUE_FAMILY_EXTERNAL_KHR, submit_family, true);
+}
+
 TEST_F(VkLayerTest, ImageBarrierWithBadRange) {
     TEST_DESCRIPTION("VkImageMemoryBarrier with an invalid subresourceRange");
 
@@ -13498,14 +13678,12 @@ TEST_F(VkLayerTest, InvalidQueryPoolCreate) {
     vkDestroyDevice(local_device, nullptr);
 }
 
-TEST_F(VkLayerTest, InvalidQueueIndexInvalidQuery) {
+TEST_F(VkLayerTest, UnclosedQuery) {
     TEST_DESCRIPTION(
-        "Use an invalid queue index in a vkCmdWaitEvents call."
         "End a command buffer with a query still in progress.");
 
     const char *invalid_query = "Ending command buffer with in progress query: queryPool 0x";
 
-    m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0a000960);
 
     ASSERT_NO_FATAL_FAILURE(Init());
 
@@ -13518,32 +13696,6 @@ TEST_F(VkLayerTest, InvalidQueueIndexInvalidQuery) {
     vkGetDeviceQueue(m_device->device(), m_device->graphics_queue_node_index_, 0, &queue);
 
     m_commandBuffer->begin();
-
-    VkImageObj image(m_device);
-    image.Init(128, 128, 1, VK_FORMAT_B8G8R8A8_UNORM, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_TILING_OPTIMAL, 0);
-    ASSERT_TRUE(image.initialized());
-    VkImageMemoryBarrier img_barrier = {};
-    img_barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
-    img_barrier.pNext = NULL;
-    img_barrier.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT;
-    img_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
-    img_barrier.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
-    img_barrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
-    img_barrier.image = image.handle();
-    img_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
-
-    // QueueFamilyIndex must be VK_QUEUE_FAMILY_IGNORED, this verifies
-    // that layer validation catches the case when it is not.
-    img_barrier.dstQueueFamilyIndex = 0;
-    img_barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
-    img_barrier.subresourceRange.baseArrayLayer = 0;
-    img_barrier.subresourceRange.baseMipLevel = 0;
-    img_barrier.subresourceRange.layerCount = 1;
-    img_barrier.subresourceRange.levelCount = 1;
-    vkCmdWaitEvents(m_commandBuffer->handle(), 1, &event, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0,
-                    nullptr, 0, nullptr, 1, &img_barrier);
-    m_errorMonitor->VerifyFound();
-
     m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, invalid_query);
 
     VkQueryPool query_pool;