data.color[i][3] = tri_data[i].a;
}
- ASSERT_NO_FATAL_FAILURE(InitState());
ASSERT_NO_FATAL_FAILURE(InitViewport());
VkConstantBufferObj constantBuffer(m_device, bufSize * 2, sizeof(float),
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
"FreeCommandBuffers is attempting to free Command Buffer");
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkCommandPool command_pool_one;
VkCommandPool command_pool_two;
"attempt to submit them on a queue created in a different "
"queue family.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
// This test is meaningless unless we have multiple queue families
auto queue_family_properties = m_device->phy().queue_properties();
if (queue_family_properties.size() < 2) {
TEST_DESCRIPTION("Generate INDEPENDENT_BLEND by disabling independent "
"blend and then specifying different blend states for two "
"attachements");
- ASSERT_NO_FATAL_FAILURE(InitState());
-
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "Invalid Pipeline CreateInfo: If independent blend feature not "
- "enabled, all elements of pAttachments must be identical");
VkPhysicalDeviceFeatures features = {};
features.independentBlend = VK_FALSE;
- std::vector<const char *> extension_names;
- VkDeviceObj noib_device(0, gpu(), extension_names, &features);
+ ASSERT_NO_FATAL_FAILURE(InitState(&features));
- VkCommandPool cmd_pool;
- VkCommandPoolCreateInfo pool_create_info{};
- pool_create_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
- pool_create_info.queueFamilyIndex = noib_device.graphics_queue_node_index_;
- pool_create_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
+ m_errorMonitor->SetDesiredFailureMsg(
+ VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ "Invalid Pipeline CreateInfo: If independent blend feature not "
+ "enabled, all elements of pAttachments must be identical");
- vkCreateCommandPool(noib_device.device(), &pool_create_info, nullptr,
- &cmd_pool);
- {
- // Need cmd_buffer's destructor to be called before calling DestroyCommandPool
- VkCommandBufferObj cmd_buffer(&noib_device, cmd_pool);
- VkDescriptorSetObj descriptorSet(&noib_device);
- descriptorSet.AppendDummy();
- descriptorSet.CreateVKDescriptorSet(&cmd_buffer);
-
- VkPipelineObj pipeline(&noib_device);
-
- VkRenderpassObj renderpass(&noib_device);
-
- VkShaderObj vs(&noib_device, bindStateVertShaderText,
- VK_SHADER_STAGE_VERTEX_BIT, this);
-
- pipeline.AddShader(&vs);
-
- VkPipelineColorBlendAttachmentState att_state1 = {}, att_state2 = {};
- att_state1.dstAlphaBlendFactor = VK_BLEND_FACTOR_CONSTANT_COLOR;
- att_state1.blendEnable = VK_TRUE;
- att_state2.dstAlphaBlendFactor = VK_BLEND_FACTOR_CONSTANT_COLOR;
- att_state2.blendEnable = VK_FALSE;
- pipeline.AddColorAttachment(0, &att_state1);
- pipeline.AddColorAttachment(1, &att_state2);
- pipeline.CreateVKPipeline(descriptorSet.GetPipelineLayout(),
- renderpass.handle());
- m_errorMonitor->VerifyFound();
- }
- vkDestroyCommandPool(noib_device.device(), cmd_pool, NULL);
+ VkDescriptorSetObj descriptorSet(m_device);
+ descriptorSet.AppendDummy();
+ descriptorSet.CreateVKDescriptorSet(m_commandBuffer);
+
+ VkPipelineObj pipeline(m_device);
+ VkRenderpassObj renderpass(m_device);
+ VkShaderObj vs(m_device, bindStateVertShaderText,
+ VK_SHADER_STAGE_VERTEX_BIT, this);
+ pipeline.AddShader(&vs);
+
+ VkPipelineColorBlendAttachmentState att_state1 = {}, att_state2 = {};
+ att_state1.dstAlphaBlendFactor = VK_BLEND_FACTOR_CONSTANT_COLOR;
+ att_state1.blendEnable = VK_TRUE;
+ att_state2.dstAlphaBlendFactor = VK_BLEND_FACTOR_CONSTANT_COLOR;
+ att_state2.blendEnable = VK_FALSE;
+ pipeline.AddColorAttachment(0, &att_state1);
+ pipeline.AddColorAttachment(1, &att_state2);
+ pipeline.CreateVKPipeline(descriptorSet.GetPipelineLayout(),
+ renderpass.handle());
+ m_errorMonitor->VerifyFound();
}
TEST_F(VkLayerTest, RenderPassDepthStencilAttachmentUnused) {
TEST_DESCRIPTION("Specify no depth attachement in renderpass then specify "
"depth attachments in subpass");
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Wait on a event then set it after the wait has been submitted.");
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkEvent event;
VkEventCreateInfo event_create_info{};
TEST_DESCRIPTION(
"Issue a query on a secondary command buffery and copy it on a primary.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
TEST_DESCRIPTION(
"Issue a query and copy from it on a second command buffer.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkEvent event;
VkEventCreateInfo event_create_info{};
event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
vkQueueSubmit(queue, 1, &submit_info, VK_NULL_HANDLE);
}
{
- m_errorMonitor->SetDesiredFailureMsg(
- VK_DEBUG_REPORT_ERROR_BIT_EXT, "Cannot call vkSetEvent() on event "
- "0x1 that is already in use by a "
- "command buffer.");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ "that is already in use by a "
+ "command buffer.");
vkSetEvent(m_device->device(), event);
m_errorMonitor->VerifyFound();
}
TEST_DESCRIPTION("Two command buffers, each in a separate QueueSubmit call "
"submitted on separate queues followed by a QueueWaitIdle.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
"submitted on separate queues, the second having a fence"
"followed by a QueueWaitIdle.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
"submitted on separate queues, the second having a fence"
"followed by two consecutive WaitForFences calls on the same fence.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
}
TEST_F(VkLayerTest, TwoQueuesEnsureCorrectRetirementWithWorkStolen) {
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2)) {
printf("Test requires two queues, skipping\n");
"submitted on separate queues, the second having a fence, "
"followed by a WaitForFences call.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
if ((m_device->queue_props.empty()) ||
(m_device->queue_props[0].queueCount < 2))
return;
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkFence fence;
VkFenceCreateInfo fence_create_info{};
fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkFence fence;
VkFenceCreateInfo fence_create_info{};
fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkFence fence;
VkFenceCreateInfo fence_create_info{};
fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
m_errorMonitor->ExpectSuccess();
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkFence fence;
VkFenceCreateInfo fence_create_info{};
fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
TEST_DESCRIPTION(
"Two command buffers each in a separate SubmitInfo sent in a single "
"QueueSubmit call followed by a WaitForFences call.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->ExpectSuccess();
"Run a simple draw calls to validate failure when Depth Bias dynamic "
"state is required but not correctly bound.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic depth bias
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Run a simple draw calls to validate failure when Line Width dynamic "
"state is required but not correctly bound.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic line width
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Run a simple draw calls to validate failure when Viewport dynamic "
"state is required but not correctly bound.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic viewport state
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Run a simple draw calls to validate failure when Scissor dynamic "
"state is required but not correctly bound.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic scissor state
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
TEST_DESCRIPTION(
"Run a simple draw calls to validate failure when Blend Constants "
"dynamic state is required but not correctly bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic blend constant state
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
TEST_DESCRIPTION(
"Run a simple draw calls to validate failure when Depth Bounds dynamic "
"state is required but not correctly bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
if (!m_device->phy().features().depthBounds) {
printf("Device does not support depthBounds test; skipped.\n");
return;
TEST_DESCRIPTION(
"Run a simple draw calls to validate failure when Stencil Read dynamic "
"state is required but not correctly bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic stencil read mask
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
TEST_DESCRIPTION(
"Run a simple draw calls to validate failure when Stencil Write dynamic"
" state is required but not correctly bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic stencil write mask
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
TEST_DESCRIPTION(
"Run a simple draw calls to validate failure when Stencil Ref dynamic "
"state is required but not correctly bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
// Dynamic stencil reference
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
TEST_F(VkLayerTest, IndexBufferNotBound) {
TEST_DESCRIPTION("Run an indexed draw call without an index buffer bound.");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Index buffer object not bound to this command buffer when Indexed ");
TEST_F(VkLayerTest, InvalidDescriptorPool) {
// Attempt to clear Descriptor Pool with bad object.
// ObjectTracker should catch this.
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Invalid Descriptor Pool Object 0xbaad6001");
uint64_t fake_pool_handle = 0xbaad6001;
VkDescriptorSetLayout bad_layout = reinterpret_cast<VkDescriptorSetLayout &>(fake_layout_handle);
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
"Invalid Descriptor Set Layout Object 0xbaad6001");
-
+ ASSERT_NO_FATAL_FAILURE(InitState());
VkPipelineLayout pipeline_layout;
VkPipelineLayoutCreateInfo plci = {};
plci.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
TEST_F(VkLayerTest, MissingClearAttachment) {
TEST_DESCRIPTION("Points to a wrong colorAttachment index in a VkClearAttachment "
"structure passed to vkCmdClearAttachments");
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
"vkCmdClearAttachments() attachment index 1 not found in attachment "
"reference array of active subpass 0");
TEST_F(VkLayerTest, MismatchCountQueueCreateRequestedFeature) {
TEST_DESCRIPTION("Use an invalid count in a vkEnumeratePhysicalDevices call."
"Use invalid Queue Family Index in vkCreateDevice");
+ ASSERT_NO_FATAL_FAILURE(InitState());
const char *mismatch_count_message =
"Call to vkEnumeratePhysicalDevices() "
TEST_DESCRIPTION("Exceed the limits of image format ");
+ ASSERT_NO_FATAL_FAILURE(InitState());
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
"CreateImage extents exceed allowable limits for format");