VALIDATION_ERROR_18a00012~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00009~^~core~^~The spec valid usage text states 'image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00009)~^~
VALIDATION_ERROR_18a00014~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00010~^~core~^~The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00010)~^~
VALIDATION_ERROR_18a00016~^~Y~^~InvalidImageLayout~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-imageLayout-00011~^~core~^~The spec valid usage text states 'imageLayout must specify the layout of the image subresource ranges of image specified in pRanges at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00011)~^~
-VALIDATION_ERROR_18a00017~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-renderpass)~^~implicit
+VALIDATION_ERROR_18a00017~^~Y~^~ClearDepthStencilImageErrors~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-renderpass~^~core~^~The spec valid usage text states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-renderpass)~^~implicit
VALIDATION_ERROR_18a00018~^~Y~^~InvalidImageLayout~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-imageLayout-00012~^~core~^~The spec valid usage text states 'imageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-imageLayout-00012)~^~
VALIDATION_ERROR_18a0001a~^~N~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-pRanges-00013~^~core~^~The spec valid usage text states 'The image range of any given element of pRanges must be an image subresource range that is contained within image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-pRanges-00013)~^~
VALIDATION_ERROR_18a0001c~^~Y~^~Unknown~^~vkCmdClearDepthStencilImage~^~VUID-vkCmdClearDepthStencilImage-image-00014~^~core~^~The spec valid usage text states 'image must have a depth/stencil format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdClearDepthStencilImage-image-00014)~^~
m_errorMonitor->VerifyFound();
}
-TEST_F(VkLayerTest, ClearDepthStencilImageWithinRenderPass) {
- // Call CmdClearDepthStencilImage within an active RenderPass
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "It is invalid to issue this call inside an active render pass");
+TEST_F(VkLayerTest, ClearDepthStencilImageErrors) {
+ // Hit errors related to vkCmdClearDepthStencilImage()
+ // 1. Use an image that doesn't have VK_IMAGE_USAGE_TRANSFER_DST_BIT set
+ // 2. Call CmdClearDepthStencilImage within an active RenderPass
ASSERT_NO_FATAL_FAILURE(Init());
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
image_create_info.extent.width = 64;
image_create_info.extent.height = 64;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
- image_create_info.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ image_create_info.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
vk_testing::Image dstImage;
dstImage.init(*m_device, (const VkImageCreateInfo &)image_create_info, reqs);
const VkImageSubresourceRange range = vk_testing::Image::subresource_range(image_create_info, VK_IMAGE_ASPECT_DEPTH_BIT);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18a00017);
vkCmdClearDepthStencilImage(m_commandBuffer->handle(), dstImage.handle(), VK_IMAGE_LAYOUT_GENERAL, &clear_value, 1, &range);