From fb399d2280123a4cd4e31e3aaabca476f68e347f Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Mon, 30 Jan 2023 16:51:43 +0900 Subject: [PATCH] Fix a bunch of validation errors of pipeline library tests. Fixes: VUID-VkGraphicsPipelineCreateInfo-flags-06608 VUID-VkGraphicsPipelineLibraryCreateInfoEXT-flags-requiredbitmask VUID-VkGraphicsPipelineCreateInfo-renderpass-06631 VUID-vkCmdPipelineBarrier-srcAccessMask-02815 VUID-vkCmdPipelineBarrier-dstAccessMask-02816 UNASSIGNED-CoreValidation-Shader-InputNotProduced VUID-vkCmdDraw-None-04007 VUID-vkCmdDraw-None-02721 Also removes 2 tests, trying to create a pipeline library with all pipeline states, which violates VUID-VkGraphicsPipelineCreateInfo-flags-06608. Affects: dEQP-VK.pipeline.pipeline_library.graphics_library.* Removed tests: dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1_1_1_1 VK-GL-CTS Issue: 4255 Components: Vulkan Change-Id: I0ed2fa28cc5626aeee60f08527a7467428354d4a --- android/cts/main/vk-master-2022-03-01/pipeline.txt | 2 - android/cts/main/vk-master/pipeline.txt | 2 - .../vulkan/pipeline/vktPipelineLibraryTests.cpp | 60 ++++++++++++++-------- .../mustpass/main/vk-default/pipeline.txt | 2 - 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/android/cts/main/vk-master-2022-03-01/pipeline.txt b/android/cts/main/vk-master-2022-03-01/pipeline.txt index 10bd417..8d41af6 100644 --- a/android/cts/main/vk-master-2022-03-01/pipeline.txt +++ b/android/cts/main/vk-master-2022-03-01/pipeline.txt @@ -276141,7 +276141,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1111 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_112 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_121 @@ -276155,7 +276154,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.fast_linked dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.link_opt_union_handle dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1 diff --git a/android/cts/main/vk-master/pipeline.txt b/android/cts/main/vk-master/pipeline.txt index 5b6aee3..4ed88a8 100644 --- a/android/cts/main/vk-master/pipeline.txt +++ b/android/cts/main/vk-master/pipeline.txt @@ -440830,7 +440830,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1111 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_112 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_121 @@ -440844,7 +440843,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.fast_linked dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.link_opt_union_handle dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1 diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineLibraryTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineLibraryTests.cpp index f38dba5..e0cd5aa 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineLibraryTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineLibraryTests.cpp @@ -92,11 +92,13 @@ struct TestParams struct RuntimePipelineTreeNode { - deInt32 parentIndex; - VkGraphicsPipelineLibraryFlagsEXT graphicsPipelineLibraryFlags; - VkGraphicsPipelineLibraryFlagsEXT subtreeGraphicsPipelineLibraryFlags; - Move pipeline; - std::vector pipelineLibraries; + deInt32 parentIndex; + VkGraphicsPipelineLibraryFlagsEXT graphicsPipelineLibraryFlags; + VkGraphicsPipelineLibraryFlagsEXT subtreeGraphicsPipelineLibraryFlags; + Move pipeline; + std::vector pipelineLibraries; + // We need to track the linked libraries too, included in VkPipelineLibraryCreateInfoKHR->pLibraries + std::vector linkedLibraryFlags; }; typedef std::vector RuntimePipelineTreeConfiguration; @@ -921,7 +923,24 @@ bool PipelineLibraryTestInstance::runTest (RuntimePipelineTreeConfiguration& run } } - if (graphicsPipelineLibraryCreateInfo.flags != ALL_GRAPHICS_PIPELINE_LIBRARY_FLAGS) + VkGraphicsPipelineLibraryFlagsEXT linkedLibrariesFlags = 0; + + for (auto flag : node.linkedLibraryFlags) + linkedLibrariesFlags |= flag; + + // When pLibraries have any pipeline library with fragment shader state and current pipeline we try to create doesn't, + // we need to set a MS info. + if ((linkedLibrariesFlags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) && + !(node.graphicsPipelineLibraryFlags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) && + (graphicsPipelineCreateInfo.pMultisampleState == DE_NULL)) + { + const VkPipelineMultisampleStateCreateInfo pipelineMultisampleStateCreateInfo = makePipelineMultisampleStateCreateInfo(); + + graphicsPipelineCreateInfo.addState(pipelineMultisampleStateCreateInfo); + } + + + if (linkedLibrariesFlags != ALL_GRAPHICS_PIPELINE_LIBRARY_FLAGS && graphicsPipelineLibraryCreateInfo.flags != 0) appendStructurePtrToVulkanChain(&graphicsPipelineCreateInfo.pNext, &graphicsPipelineLibraryCreateInfo); if (linkingInfo.libraryCount != 0) @@ -930,6 +949,15 @@ bool PipelineLibraryTestInstance::runTest (RuntimePipelineTreeConfiguration& run graphicsPipelineCreateInfo.layout = *pipelineLayoutSame; } + linkedLibrariesFlags |= node.graphicsPipelineLibraryFlags; + + // if current pipeline that we try to create and pLibraries have all states of pipelines, we are not allowed to create a pipeline library. + if (linkedLibrariesFlags == ALL_GRAPHICS_PIPELINE_LIBRARY_FLAGS) + { + DE_ASSERT(!buildLibrary); + graphicsPipelineCreateInfo.flags &= ~VK_PIPELINE_CREATE_LIBRARY_BIT_KHR; + } + node.pipeline = createGraphicsPipeline(vk, device, DE_NULL, &graphicsPipelineCreateInfo); if (buildLibrary) @@ -937,6 +965,7 @@ bool PipelineLibraryTestInstance::runTest (RuntimePipelineTreeConfiguration& run DE_ASSERT(de::inBounds(node.parentIndex, 0, static_cast(runtimePipelineTreeConfiguration.size()))); runtimePipelineTreeConfiguration[node.parentIndex].pipelineLibraries.push_back(*node.pipeline); + runtimePipelineTreeConfiguration[node.parentIndex].linkedLibraryFlags.push_back(linkedLibrariesFlags); } else { @@ -1494,7 +1523,7 @@ tcu::TestStatus PipelineLibraryMiscTestInstance::runNullDescriptorSet(void) }; // fill proper portion of pipeline state - updateVertexInputInterface(m_context, partialPipelineCreateInfo[0], VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); + updateVertexInputInterface(m_context, partialPipelineCreateInfo[0], VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, 0u); updatePreRasterization(m_context, partialPipelineCreateInfo[0], false); updatePostRasterization(m_context, partialPipelineCreateInfo[1], false); updateFragmentOutputInterface(m_context, partialPipelineCreateInfo[1]); @@ -1544,7 +1573,7 @@ tcu::TestStatus PipelineLibraryMiscTestInstance::runNullDescriptorSet(void) uniformBufferDataSize // VkDeviceSize size )); initialBufferBarriers[1].buffer = uniformBuffer[1]->get(); - vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, (VkDependencyFlags)0, 0, DE_NULL, 2, initialBufferBarriers.data(), 0, DE_NULL); + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, DE_NULL, 2, initialBufferBarriers.data(), 0, DE_NULL); beginRenderPass(vk, *m_cmdBuffer, *m_renderPass, *m_framebuffer, m_renderArea, m_colorClearColor); @@ -2057,8 +2086,7 @@ void PipelineLibraryMiscTestCase::initPrograms(SourceCollections& programCollect { programCollection.glslSources.add("vert") << glu::VertexSource( "#version 450\n" - "precision mediump int; precision highp float;" - "layout(location = 0) in vec4 in_position;\n" + "precision mediump int; precision highp float;\n" "layout(set = 0, binding = 0) uniform bufA\n" "{\n" " vec4 valueA;\n" @@ -2234,18 +2262,6 @@ void addPipelineLibraryConfigurationsTests (tcu::TestCaseGroup* group, bool opti /* / */ { 2, 1 }, /* 1 */ } }, - - { { - { R, 0 }, /* 0 */ - /* / */ - { 0, 1 }, /* 1 */ - /* / */ - { 1, 1 }, /* 1 */ - /* / */ - { 2, 1 }, /* 1 */ - /* / */ - { 3, 1 }, /* 1 */ - } }, }; for (size_t libConfigNdx = 0; libConfigNdx < DE_LENGTH_OF_ARRAY(pipelineTreeConfiguration); ++libConfigNdx) diff --git a/external/vulkancts/mustpass/main/vk-default/pipeline.txt b/external/vulkancts/mustpass/main/vk-default/pipeline.txt index dace40f..2f08037 100644 --- a/external/vulkancts/mustpass/main/vk-default/pipeline.txt +++ b/external/vulkancts/mustpass/main/vk-default/pipeline.txt @@ -440912,7 +440912,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.fast.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.fast.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1111 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_112 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_121 @@ -440926,7 +440925,6 @@ dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_01_11_1 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_01_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_11 dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.1_1_1_1 -dEQP-VK.pipeline.pipeline_library.graphics_library.optimize.0_1_1_1_1 dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.fast_linked dEQP-VK.pipeline.pipeline_library.graphics_library.misc.independent_pipeline_layout_sets.link_opt_union_handle dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1 -- 2.7.4