tests: Update vkCreateFramebuffer tests
- Add tests for width/height/layers of zero.
- Fix one VU check that wasn't using its corresponding error code.
- Migrate string-based tests to error-code-based variants.
- database update.
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 0dabef9..41a342d 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -3886,15 +3886,14 @@
" 4. Mismatch framebuffer & renderPass attachment #samples\n"
" 5. Framebuffer attachment w/ non-1 mip-levels\n"
" 6. Framebuffer attachment where dimensions don't match\n"
- " 7. Framebuffer attachment w/o identity swizzle\n"
- " 8. framebuffer dimensions exceed physical device limits\n");
+ " 7. Framebuffer attachment where dimensions don't match\n"
+ " 8. Framebuffer attachment w/o identity swizzle\n"
+ " 9. framebuffer dimensions exceed physical device limits\n");
ASSERT_NO_FATAL_FAILURE(Init());
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "vkCreateFramebuffer(): VkFramebufferCreateInfo attachmentCount of 2 does not match attachmentCount of 1 of ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00404);
// Create a renderPass with a single color attachment
VkAttachmentReference attach = {};
@@ -3949,7 +3948,7 @@
fb_info.attachmentCount = 1;
fb_info.renderPass = rp_ds;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, " conflicts with the image's IMAGE_USAGE flags ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00406);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -3968,8 +3967,7 @@
// Cause error due to mis-matched formats between rp & fb
// rp attachment 0 now has RGBA8 but corresponding fb attach is BGRA8
fb_info.renderPass = rp;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
- " has format of VK_FORMAT_B8G8R8A8_UNORM that does not match ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00408);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -3986,8 +3984,7 @@
// Cause error due to mis-matched sample count between rp & fb
fb_info.renderPass = rp;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
- " has VK_SAMPLE_COUNT_1_BIT samples that do not match the VK_SAMPLE_COUNT_4_BIT ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00409);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -4025,7 +4022,7 @@
fb_info.renderPass = rp;
fb_info.pAttachments = &view;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, " has mip levelCount of 2 but only ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00411);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -4040,7 +4037,7 @@
fb_info.height = 1024;
fb_info.width = 1024;
fb_info.layers = 2;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, " Attachment dimensions must be at least as large. ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00410);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -4077,9 +4074,7 @@
fb_info.width = 100;
fb_info.layers = 1;
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- " has non-identy swizzle. All framebuffer attachments must have been created with the identity swizzle. ");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00412);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
@@ -4097,13 +4092,16 @@
fb_info.height = 100;
fb_info.layers = 1;
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00413);
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "has dimensions smaller than the corresponding framebuffer dimensions. Attachment dimensions must be at least as large. "
- "Here are the respective dimensions for attachment");
-
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00410);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
-
+ m_errorMonitor->VerifyFound();
+ if (err == VK_SUCCESS) {
+ vkDestroyFramebuffer(m_device->device(), fb, NULL);
+ }
+ // and width=0
+ fb_info.width = 0;
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_02806);
+ err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
if (err == VK_SUCCESS) {
vkDestroyFramebuffer(m_device->device(), fb, NULL);
@@ -4114,12 +4112,16 @@
fb_info.height = m_device->props.limits.maxFramebufferHeight + 1;
fb_info.layers = 1;
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00414);
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "has dimensions smaller than the corresponding framebuffer dimensions. Attachment dimensions must be at least as large. "
- "Here are the respective dimensions for attachment");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00410);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
-
+ m_errorMonitor->VerifyFound();
+ if (err == VK_SUCCESS) {
+ vkDestroyFramebuffer(m_device->device(), fb, NULL);
+ }
+ // and height=0
+ fb_info.height = 0;
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_02807);
+ err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
if (err == VK_SUCCESS) {
vkDestroyFramebuffer(m_device->device(), fb, NULL);
@@ -4130,12 +4132,16 @@
fb_info.height = 100;
fb_info.layers = m_device->props.limits.maxFramebufferLayers + 1;
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00415);
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "has dimensions smaller than the corresponding framebuffer dimensions. Attachment dimensions must be at least as large. "
- "Here are the respective dimensions for attachment");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_00410);
err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
-
+ m_errorMonitor->VerifyFound();
+ if (err == VK_SUCCESS) {
+ vkDestroyFramebuffer(m_device->device(), fb, NULL);
+ }
+ // and layers=0
+ fb_info.layers = 0;
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_02808);
+ err = vkCreateFramebuffer(device(), &fb_info, NULL, &fb);
m_errorMonitor->VerifyFound();
if (err == VK_SUCCESS) {
vkDestroyFramebuffer(m_device->device(), fb, NULL);