tests: Fix VkLayerTest.InUseDestroyedSignaled
- Peel off an easy subtest from the front into its own test
- Fix command buffer usage
- Remove suppression of log messages
There is a lot more work to do in this test to make it really sensible,
but this is enough to make it work.
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 3978f82..9573e9d 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -12324,13 +12324,7 @@
vkDestroyCommandPool(test_device.handle(), command_pool, NULL);
}
-TEST_F(VkLayerTest, InUseDestroyedSignaled) {
- TEST_DESCRIPTION(
- "Use vkCmdExecuteCommands with invalid state "
- "in primary and secondary command buffers. "
- "Delete objects that are inuse. Call VkQueueSubmit "
- "with an event that has been deleted.");
-
+TEST_F(VkLayerTest, EventInUseDestroyedSignaled) {
ASSERT_NO_FATAL_FAILURE(Init());
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
@@ -12352,11 +12346,19 @@
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "that is invalid because bound");
vkQueueSubmit(m_device->m_queue, 1, &submit_info, VK_NULL_HANDLE);
m_errorMonitor->VerifyFound();
+}
- m_errorMonitor->ExpectSuccess(0); // disable all log message processing with flags==0
- vkResetCommandBuffer(m_commandBuffer->handle(), 0);
+TEST_F(VkLayerTest, InUseDestroyedSignaled) {
+ TEST_DESCRIPTION(
+ "Use vkCmdExecuteCommands with invalid state "
+ "in primary and secondary command buffers. "
+ "Delete objects that are inuse. Call VkQueueSubmit "
+ "with an event that has been deleted.");
- vkCreateEvent(m_device->device(), &event_create_info, nullptr, &event);
+ ASSERT_NO_FATAL_FAILURE(Init());
+ ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
+
+ m_errorMonitor->ExpectSuccess();
VkSemaphoreCreateInfo semaphore_create_info = {};
semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
@@ -12437,7 +12439,13 @@
pipe.CreateVKPipeline(pipeline_layout, m_renderPass);
+ VkEvent event;
+ VkEventCreateInfo event_create_info = {};
+ event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
+ vkCreateEvent(m_device->device(), &event_create_info, nullptr, &event);
+
m_commandBuffer->BeginCommandBuffer();
+
vkCmdSetEvent(m_commandBuffer->handle(), event, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
vkCmdBindPipeline(m_commandBuffer->GetBufferHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.handle());
@@ -12446,6 +12454,10 @@
m_commandBuffer->EndCommandBuffer();
+ VkSubmitInfo submit_info = {};
+ submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+ submit_info.commandBufferCount = 1;
+ submit_info.pCommandBuffers = &m_commandBuffer->handle();
submit_info.signalSemaphoreCount = 1;
submit_info.pSignalSemaphores = &semaphore;
vkQueueSubmit(m_device->m_queue, 1, &submit_info, fence);