Skip to content
This repository was archived by the owner on Jul 19, 2018. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tests/layer_validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6013,6 +6013,8 @@ TEST_F(VkLayerTest, RenderPassInUseDestroyedSignaled) {

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

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

Expand Down Expand Up @@ -12426,17 +12429,20 @@ TEST_F(VkLayerTest, RenderPassIncompatible) {
rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
rpbi.framebuffer = m_framebuffer;
rpbi.renderPass = rp;
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_12000710);
vkCmdBeginRenderPass(m_commandBuffer->handle(), &rpbi, VK_SUBPASS_CONTENTS_INLINE);
m_errorMonitor->VerifyFound();
// Now we want to bind the RenderPass to trigger Draw-time error so allow the error for this call
// The better way to do this to avoid the error would be to create separate FB with compatible RP

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should really do this properly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From private chat: This error is no good to hide because it exposes the driver to an incorrect call. It would be perfectly reasonable for the driver to explode or subtly corrupt itself as a result of this.

// and use that FB for this begin instead of m_framebuffer
m_errorMonitor->SetUnexpectedError("vkCmdBeginRenderPass(): RenderPasses incompatible between ");
vkCmdBeginRenderPass(m_commandBuffer->handle(), &rpbi, VK_SUBPASS_CONTENTS_INLINE);
// m_errorMonitor->VerifyFound();
vkCmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.handle());

m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_1a200366);
// Render triangle (the error should trigger on the attempt to draw).
m_commandBuffer->Draw(3, 1, 0, 0);

// Finalize recording of the command buffer
m_commandBuffer->EndRenderPass();
m_commandBuffer->end();

m_errorMonitor->VerifyFound();

vkDestroyPipelineLayout(m_device->device(), pipeline_layout, NULL);
Expand Down