diff options
author | Locke <locke@lunarg.com> | 2019-04-15 20:15:25 -0600 |
---|---|---|
committer | Locke Lin <47329816+locke-lunarg@users.noreply.github.com> | 2019-04-22 15:42:06 -0600 |
commit | 61b46f923e8826ddc38c6578f2e3c4907bee7cd9 (patch) | |
tree | 45e44a7f7a1abbc082a4507686ab6346d4d91ef1 /tests/layer_validation_tests.cpp | |
parent | 75096b38ee1df3b778d292c85bca337974277c41 (diff) | |
download | vulkan-validation-layers-61b46f923e8826ddc38c6578f2e3c4907bee7cd9.tar.gz |
tests: bind pipeline to avoid crash
In Intel GUP, it will crash if it runs
vkCmdPushDescriptorSetKHR without vkCmdBindPipeline.
Change-Id: Ibbfe25b5c0a713f529dc03e4251de38727b0847e
Diffstat (limited to 'tests/layer_validation_tests.cpp')
-rw-r--r-- | tests/layer_validation_tests.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp index 7d4dc58d2..130b347c3 100644 --- a/tests/layer_validation_tests.cpp +++ b/tests/layer_validation_tests.cpp @@ -30238,6 +30238,9 @@ TEST_F(VkPositiveLayerTest, PushDescriptorNullDstSetTest) { return; } + ASSERT_NO_FATAL_FAILURE(InitViewport()); + ASSERT_NO_FATAL_FAILURE(InitRenderTarget()); + VkDescriptorSetLayoutBinding dsl_binding = {}; dsl_binding.binding = 2; dsl_binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; @@ -30245,10 +30248,16 @@ TEST_F(VkPositiveLayerTest, PushDescriptorNullDstSetTest) { dsl_binding.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; dsl_binding.pImmutableSamplers = NULL; - const VkDescriptorSetLayoutObj ds_layout(m_device, {dsl_binding}, VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR); + const VkDescriptorSetLayoutObj ds_layout(m_device, {dsl_binding}); + // Create push descriptor set layout + const VkDescriptorSetLayoutObj push_ds_layout(m_device, {dsl_binding}, VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR); - // Now use the descriptor layout to create a pipeline layout - const VkPipelineLayoutObj pipeline_layout(m_device, {&ds_layout}); + // Use helper to create graphics pipeline + CreatePipelineHelper helper(*this); + helper.InitInfo(); + helper.InitState(); + helper.pipeline_layout_ = VkPipelineLayoutObj(m_device, {&push_ds_layout, &ds_layout}); + helper.CreateGraphicsPipeline(); static const float vbo_data[3] = {1.f, 0.f, 1.f}; VkConstantBufferObj vbo(m_device, sizeof(vbo_data), (const void *)&vbo_data, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); @@ -30271,8 +30280,12 @@ TEST_F(VkPositiveLayerTest, PushDescriptorNullDstSetTest) { PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)vkGetDeviceProcAddr(m_device->device(), "vkCmdPushDescriptorSetKHR"); assert(vkCmdPushDescriptorSetKHR != nullptr); + m_commandBuffer->begin(); - vkCmdPushDescriptorSetKHR(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout.handle(), 0, 1, + + // In Intel GPU, it needs to bind pipeline before push descriptor set. + vkCmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, helper.pipeline_); + vkCmdPushDescriptorSetKHR(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, helper.pipeline_layout_.handle(), 0, 1, &descriptor_write); m_errorMonitor->VerifyNotFound(); |