Skip to content
This repository was archived by the owner on Jul 19, 2018. It is now read-only.

Commit ff2b867

Browse files
committed
tests:Update RenderPassIncompatible test
Add check for the case where renderPass and framebuffer used at CmdBeginRenderPass() time are incompatible. Add unexpected error to then allow that CmdBeginRenderPass() call so that draw-time pipeline renderPass incompatible case can then be flagged.
1 parent 97fadcf commit ff2b867

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

tests/layer_validation_tests.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6013,6 +6013,8 @@ TEST_F(VkLayerTest, RenderPassInUseDestroyedSignaled) {
60136013

60146014
// Wait for queue to complete so we can safely destroy rp
60156015
vkQueueWaitIdle(m_device->m_queue);
6016+
m_errorMonitor->SetUnexpectedError("If renderPass is not VK_NULL_HANDLE, renderPass must be a valid VkRenderPass handle");
6017+
m_errorMonitor->SetUnexpectedError("Unable to remove RenderPass obj");
60166018
vkDestroyRenderPass(m_device->device(), rp, nullptr);
60176019
}
60186020

@@ -12355,7 +12357,8 @@ TEST_F(VkLayerTest, NumSamplesMismatch) {
1235512357
TEST_F(VkLayerTest, RenderPassIncompatible) {
1235612358
TEST_DESCRIPTION(
1235712359
"Hit RenderPass incompatible cases. "
12358-
"Initial case is drawing with an active renderpass that's "
12360+
"First attempt BeginRenderPass() with incompatible FrameBuffer,"
12361+
"then attempt to draw with an active renderpass that's "
1235912362
"not compatible with the bound pipeline state object's creation renderpass");
1236012363
VkResult err;
1236112364

@@ -12426,17 +12429,20 @@ TEST_F(VkLayerTest, RenderPassIncompatible) {
1242612429
rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
1242712430
rpbi.framebuffer = m_framebuffer;
1242812431
rpbi.renderPass = rp;
12432+
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_12000710);
1242912433
vkCmdBeginRenderPass(m_commandBuffer->handle(), &rpbi, VK_SUBPASS_CONTENTS_INLINE);
12434+
m_errorMonitor->VerifyFound();
12435+
// Now we want to bind the RenderPass to trigger Draw-time error so allow the error for this call
12436+
// The better way to do this to avoid the error would be to create separate FB with compatible RP
12437+
// and use that FB for this begin instead of m_framebuffer
12438+
m_errorMonitor->SetUnexpectedError("vkCmdBeginRenderPass(): RenderPasses incompatible between ");
12439+
vkCmdBeginRenderPass(m_commandBuffer->handle(), &rpbi, VK_SUBPASS_CONTENTS_INLINE);
12440+
// m_errorMonitor->VerifyFound();
1243012441
vkCmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.handle());
1243112442

1243212443
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_1a200366);
1243312444
// Render triangle (the error should trigger on the attempt to draw).
1243412445
m_commandBuffer->Draw(3, 1, 0, 0);
12435-
12436-
// Finalize recording of the command buffer
12437-
m_commandBuffer->EndRenderPass();
12438-
m_commandBuffer->end();
12439-
1244012446
m_errorMonitor->VerifyFound();
1244112447

1244212448
vkDestroyPipelineLayout(m_device->device(), pipeline_layout, NULL);

0 commit comments

Comments
 (0)