summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-04-26 16:53:52 -0600
committerTobin Ehlis <tobine@google.com>2017-04-27 00:41:29 -0600
commitd1952820d1c5b4e2b85d6a97519b001bca56c748 (patch)
tree7d126499cc678d818f579761c47effcb08a46341
parentc7455116cef9c14f8405aae43bc0247f2c256f96 (diff)
tests:Test VALIDATION_ERROR_00302
InvalidBarriers test was already checking case VALIDATION_ERROR_00302 but it was doing so based on setting COLOR aspect bit. Add another case where depth bit is excluded and verify that error is correctly triggered.
-rw-r--r--layers/vk_validation_error_database.txt2
-rw-r--r--tests/layer_validation_tests.cpp18
2 files changed, 12 insertions, 8 deletions
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index c991b21c..fc98723e 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -293,7 +293,7 @@ VALIDATION_ERROR_00295~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~For more informati
VALIDATION_ERROR_00296~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which 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-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
VALIDATION_ERROR_00297~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
VALIDATION_ERROR_00300~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are valid queue families, 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-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
-VALIDATION_ERROR_00302~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'If image has a depth/stencil format with both depth and stencil components, then 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-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
+VALIDATION_ERROR_00302~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'If image has a depth/stencil format with both depth and stencil components, then 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-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
VALIDATION_ERROR_00303~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which 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-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
VALIDATION_ERROR_00304~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
VALIDATION_ERROR_00305~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~For more information refer to Vulkan Spec Section '6.7.3. Image Memory Barriers' which states 'If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkImageMemoryBarrier)~^~
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 89060482..0dabef9e 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -9238,9 +9238,8 @@ TEST_F(VkLayerTest, InvalidBarriers) {
m_errorMonitor->VerifyFound();
// Now exercise barrier aspect bit errors, first DS
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "Depth/stencil image formats must have at least one of VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT set.");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00741);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00302);
VkDepthStencilObj ds_image(m_device);
ds_image.Init(m_device, 128, 128, depth_format);
ASSERT_TRUE(ds_image.initialized());
@@ -9254,10 +9253,15 @@ TEST_F(VkLayerTest, InvalidBarriers) {
nullptr, 0, nullptr, 1, &img_barrier);
m_errorMonitor->VerifyFound();
- // Having anything other than DEPTH or STENCIL is an error
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "Combination depth/stencil image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT set.");
+ // Having only one of depth or stencil set for DS image is an error
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00302);
+ img_barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
+ vkCmdPipelineBarrier(m_commandBuffer->GetBufferHandle(), VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, 0, 0,
+ nullptr, 0, nullptr, 1, &img_barrier);
+ m_errorMonitor->VerifyFound();
+
+ // Having anything other than DEPTH and STENCIL is an error
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00741);
img_barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_COLOR_BIT;
vkCmdPipelineBarrier(m_commandBuffer->GetBufferHandle(), VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, 0, 0,
nullptr, 0, nullptr, 1, &img_barrier);