tests: Hit another invalid image layout error case
Hit the case when a renderpass attachment with CLEAR loadOp starts
out in a READ_ONLY layout.
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 2ddf42e..3343184 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -6719,6 +6719,7 @@
VkAttachmentDescription attach_desc = {};
attach_desc.format = VK_FORMAT_UNDEFINED;
rpci.pAttachments = &attach_desc;
+ rpci.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
VkRenderPass rp;
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
@@ -6766,6 +6767,24 @@
"Layout for depth attachment is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL but can only be DEPTH_STENCIL_ATTACHMENT_OPTIMAL or GENERAL.");
vkCreateRenderPass(m_device->device(), &rpci, NULL, &rp);
m_errorMonitor->VerifyFound();
+ // For this error we need a valid renderpass so create default one
+ attach.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
+ attach.attachment = 0;
+ attach_desc.format = VK_FORMAT_D24_UNORM_S8_UINT;
+ attach_desc.samples = VK_SAMPLE_COUNT_1_BIT;
+ attach_desc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
+ attach_desc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ attach_desc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ // Can't do a CLEAR load on READ_ONLY initialLayout
+ attach_desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attach_desc.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
+ attach_desc.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ " with invalid first layout "
+ "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_"
+ "ONLY_OPTIMAL");
+ vkCreateRenderPass(m_device->device(), &rpci, NULL, &rp);
+ m_errorMonitor->VerifyFound();
vkDestroyImage(m_device->device(), src_image, NULL);
vkDestroyImage(m_device->device(), dst_image, NULL);