Merge vk-gl-cts/vulkan-cts-1.3.4 into vk-gl-cts/main
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Mon, 19 Dec 2022 08:11:13 +0000 (09:11 +0100)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Mon, 19 Dec 2022 08:23:34 +0000 (09:23 +0100)
Change-Id: I4518d23a12781a845bc33bacd811b692689ef907

1  2 
external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateDSTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineLibraryTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderFragmentMaskTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampledRenderToSingleSampledTests.cpp

@@@ -729,19 -621,17 +729,20 @@@ void DepthBoundsTestInstance::initFrame
  
  void DepthBoundsTestInstance::initPipeline (const vk::VkDevice device)
  {
 -      const vk::Unique<vk::VkShaderModule>    vs                      (createShaderModule(m_vk, device, m_context.getBinaryCollection().get(m_vertexShaderName), 0));
 -      const vk::Unique<vk::VkShaderModule>    fs                      (createShaderModule(m_vk, device, m_context.getBinaryCollection().get(m_fragmentShaderName), 0));
 -      std::vector<vk::VkViewport>                             viewports       { { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } };
 -      std::vector<vk::VkRect2D>                               scissors        { { { 0u, 0u }, { 0u, 0u } } };
 +      // Shaders.
 +      const auto&                                                     binaries        = m_context.getBinaryCollection();
 +      const vk::Move<vk::VkShaderModule>      fs                      = createShaderModule(m_vk, device, binaries.get(m_fragmentShaderName));
 +      const vk::Move<vk::VkShaderModule>      vs                      = (m_isMesh ? vk::Move<vk::VkShaderModule>() : createShaderModule(m_vk, device, binaries.get(m_vertexShaderName)));
 +      const vk::Move<vk::VkShaderModule>      ms                      = (m_isMesh ? createShaderModule(m_vk, device, binaries.get(m_meshShaderName)) : vk::Move<vk::VkShaderModule>());
 +      std::vector<vk::VkViewport>                     viewports       { { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } };
 +      std::vector<vk::VkRect2D>                       scissors        { { { 0u, 0u }, { 0u, 0u } } };
  
-       const PipelineCreateInfo::ColorBlendState::Attachment   attachmentState;
-       const PipelineCreateInfo::ColorBlendState                               colorBlendState(1u, static_cast<const vk::VkPipelineColorBlendAttachmentState*>(&attachmentState));
-       const PipelineCreateInfo::RasterizerState                               rasterizerState;
-       const PipelineCreateInfo::DepthStencilState                             depthStencilState(false, false, vk::VK_COMPARE_OP_NEVER, true);
-       const PipelineCreateInfo::DynamicState                                  dynamicState;
+       const PipelineCreateInfo::ColorBlendState::Attachment           attachmentState;
+       const PipelineCreateInfo::ColorBlendState                                       colorBlendState(1u, static_cast<const vk::VkPipelineColorBlendAttachmentState*>(&attachmentState));
+       const PipelineCreateInfo::RasterizerState                                       rasterizerState;
+       const PipelineCreateInfo::DepthStencilState::StencilOpState stencilOpState(vk::VK_STENCIL_OP_KEEP, vk::VK_STENCIL_OP_KEEP, vk::VK_STENCIL_OP_KEEP);
+       const PipelineCreateInfo::DepthStencilState                                     depthStencilState(false, false, vk::VK_COMPARE_OP_NEVER, true, 0u, stencilOpState, stencilOpState);
+       const PipelineCreateInfo::DynamicState                                          dynamicState;
  
        m_pipeline.setDefaultTopology(m_topology)
                          .setDynamicState(static_cast<const vk::VkPipelineDynamicStateCreateInfo*>(&dynamicState))
@@@ -2531,48 -2252,12 +2580,49 @@@ void PipelineLibraryMiscTestCase::initP
                        "#version 450\n"
                        "precision mediump int; precision highp float;"
                        "layout(location = 0) out highp vec4 o_color;\n"
+                       "layout(constant_id = 0) const int random = 0;\n\n"
                        "void main()\n"
                        "{\n"
-                       "  o_color = vec4(0.0, 1.0, 0.5, 1.0);\n"
+                       "  o_color = vec4(0.0, 1.0, 0.5, 1.0) + float(random & 1);\n"
                        "}\n");
        }
 +      else if (m_testParams.mode == MiscTestMode::SHADER_MODULE_CREATE_INFO_COMP)
 +      {
 +              std::ostringstream comp;
 +              comp
 +                      << "#version 450\n"
 +                      << "layout (set=0, binding=0, std430) buffer BufferBlock {\n"
 +                      << "    uint values[" << PipelineLibraryShaderModuleInfoInstance::kOutputBufferElements << "];\n"
 +                      << "} outBuffer;\n"
 +                      << "layout (local_size_x=" << PipelineLibraryShaderModuleInfoInstance::kOutputBufferElements << ", local_size_y=1, local_size_z=1) in;\n"
 +                      << "void main (void)\n"
 +                      << "{\n"
 +                      << "    outBuffer.values[gl_LocalInvocationIndex] = gl_LocalInvocationIndex;\n"
 +                      << "}\n"
 +                      ;
 +              programCollection.glslSources.add("comp") << glu::ComputeSource(comp.str());
 +      }
 +      else if (m_testParams.mode == MiscTestMode::SHADER_MODULE_CREATE_INFO_RT || m_testParams.mode == MiscTestMode::SHADER_MODULE_CREATE_INFO_RT_LIB)
 +      {
 +              const vk::ShaderBuildOptions    buildOptions (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_4, 0u, true);
 +              std::ostringstream                              rgen;
 +              rgen
 +                      << "#version 460 core\n"
 +                      << "#extension GL_EXT_ray_tracing : require\n"
 +                      << "layout (set=0, binding=0, std430) buffer BufferBlock {\n"
 +                      << "    uint values[" << PipelineLibraryShaderModuleInfoInstance::kOutputBufferElements << "];\n"
 +                      << "} outBuffer;\n"
 +                      << "void main (void)\n"
 +                      << "{\n"
 +                      << "    outBuffer.values[gl_LaunchIDEXT.x] = gl_LaunchIDEXT.x;\n"
 +                      << "}\n"
 +                      ;
 +              programCollection.glslSources.add("rgen") << glu::RaygenSource(rgen.str()) << buildOptions;
 +      }
 +      else
 +      {
 +              DE_ASSERT(false);
 +      }
  }
  
  TestInstance* PipelineLibraryMiscTestCase::createInstance(Context& context) const