Shader validation: respect Vulkan version, relaxed layout requirement
authorDavid Neto <dneto@google.com>
Fri, 21 Sep 2018 14:36:56 +0000 (10:36 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 25 Sep 2018 10:28:07 +0000 (06:28 -0400)
Pass more info to SPIR-V validation:
- Target Vulkan version
- Whether the test case requested relaxed layout

When a shader is built with VK_KHR_relaxed_block_layout, the SPIR-V
module does not record the setting.  But SPIR-V module validation
for Vulkan 1.0 must know if block layout should be relaxed.
Vulkan 1.1 includes VK_KHR_relaxed_block_layout in core.

Adds the necessary state to framework program build options objects to
pass those options to the SPIR-V validator.

Update SPIRV-Tools, SPIRV-Headers, Glslang to just befor NV Turing extensions.
Make sure we have the entry point:
  spvValidatorOptionsSetRelaxedBlockLayout

Change-Id: I74511629a4e56a4fea370ffe3a21677465a4510f
Component: Framework
VK-GL-CTS: 1266, 1270

30 files changed:
external/fetch_sources.py
external/vulkancts/framework/vulkan/vkPrograms.cpp
external/vulkancts/framework/vulkan/vkPrograms.hpp
external/vulkancts/framework/vulkan/vkShaderProgram.hpp
external/vulkancts/framework/vulkan/vkSpirVAsm.cpp
external/vulkancts/framework/vulkan/vkSpirVAsm.hpp
external/vulkancts/framework/vulkan/vkSpirVProgram.hpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm16bitStorageTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmLoopDepInfTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmLoopDepLenTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmSpirvVersionTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariableInitTests.cpp
external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBasicTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp
external/vulkancts/modules/vulkan/vktBuildPrograms.cpp
external/vulkancts/modules/vulkan/vktTestPackage.cpp

index c99d591..f680d81 100755 (executable)
@@ -252,17 +252,17 @@ PACKAGES = [
        GitRepo(
                "https://github.com/KhronosGroup/SPIRV-Tools.git",
                None,
-               "gitlab-spv-khr-8bit-storage",
+               "90a12b3d4d1d589b3d61c194f983eb9c22459226",
                "spirv-tools"),
        GitRepo(
                "https://github.com/KhronosGroup/glslang.git",
                None,
-               "afe0c66f657c536c32b9f070e7f4d9ae932cc6e0",
+               "d122a72852900eed187fa95bdebf97a70bf6af2",
                "glslang"),
        GitRepo(
                "https://github.com/KhronosGroup/SPIRV-Headers.git",
                None,
-               "ff684ffc6a35d2a58f0f63108877d0064ea33feb",
+               "d5b2e1255f706ce1f88812217e9a554f299848af",
                "spirv-headers"),
 ]
 
index 4d18ab6..6e3d81e 100644 (file)
@@ -336,11 +336,11 @@ ProgramBinary* createProgramBinaryFromSpirV (const vector<deUint32>& binary)
 
 } // anonymous
 
-void validateCompiledBinary(const vector<deUint32>& binary, glu::ShaderProgramInfo* buildInfo, const SpirvVersion spirvVersion)
+void validateCompiledBinary(const vector<deUint32>& binary, glu::ShaderProgramInfo* buildInfo, deUint32 vulkanVersion, const SpirvVersion spirvVersion, const bool relaxedLayout)
 {
        std::ostringstream validationLog;
 
-       if (!validateSpirV(binary.size(), &binary[0], &validationLog, spirvVersion))
+       if (!validateSpirV(binary.size(), &binary[0], &validationLog, vulkanVersion, spirvVersion, relaxedLayout))
        {
                buildInfo->program.linkOk        = false;
                buildInfo->program.infoLog      += "\n" + validationLog.str();
@@ -603,7 +603,10 @@ ProgramBinary* buildProgram (const GlslSource& program, glu::ShaderProgramInfo*
                }
 
                if (validateBinary)
-                       validateCompiledBinary(binary, buildInfo, spirvVersion);
+               {
+                       const bool relaxedLayout = program.buildOptions.flags & ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS;
+                       validateCompiledBinary(binary, buildInfo, program.buildOptions.vulkanVersion, spirvVersion, relaxedLayout);
+               }
 
                if (optimizationRecipe != 0)
                        optimizeCompiledBinary(binary, optimizationRecipe, spirvVersion);
@@ -683,7 +686,10 @@ ProgramBinary* buildProgram (const HlslSource& program, glu::ShaderProgramInfo*
                }
 
                if (validateBinary)
-                       validateCompiledBinary(binary, buildInfo, spirvVersion);
+               {
+                       const bool relaxedLayout = program.buildOptions.flags & ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS;
+                       validateCompiledBinary(binary, buildInfo, program.buildOptions.vulkanVersion, spirvVersion, relaxedLayout);
+               }
 
                if (optimizationRecipe != 0)
                        optimizeCompiledBinary(binary, optimizationRecipe, spirvVersion);
@@ -740,8 +746,9 @@ ProgramBinary* assembleProgram (const SpirVAsmSource& program, SpirVProgramInfo*
                if (validateBinary)
                {
                        std::ostringstream      validationLog;
+                       const bool                      relaxedLayout   = false;
 
-                       if (!validateSpirV(binary.size(), &binary[0], &validationLog, spirvVersion))
+                       if (!validateSpirV(binary.size(), &binary[0], &validationLog, program.buildOptions.vulkanVersion, spirvVersion, relaxedLayout))
                        {
                                buildInfo->compileOk = false;
                                buildInfo->infoLog += "\n" + validationLog.str();
@@ -794,7 +801,7 @@ void disassembleProgram (const ProgramBinary& program, std::ostream* dst)
                TCU_THROW(NotSupportedError, "Unsupported program format");
 }
 
-bool validateProgram (const ProgramBinary& program, std::ostream* dst)
+bool validateProgram (const ProgramBinary& program, std::ostream* dst, deUint32 vulkanVersion, bool relaxedLayout)
 {
        if (program.getFormat() == PROGRAM_FORMAT_SPIRV)
        {
@@ -806,7 +813,7 @@ bool validateProgram (const ProgramBinary& program, std::ostream* dst)
 
                if (isNativeSpirVBinaryEndianness())
                        return validateSpirV(program.getSize()/sizeof(deUint32), (const deUint32*)program.getBinary(), dst,
-                                                                extractSpirvVersion(program));
+                                                                vulkanVersion, extractSpirvVersion(program), relaxedLayout);
                else
                        TCU_THROW(InternalError, "SPIR-V endianness translation not supported");
        }
index f6a2aa7..4087f9f 100644 (file)
@@ -211,7 +211,7 @@ ProgramBinary*                      buildProgram            (const GlslSource& program, glu::ShaderProgramInf
 ProgramBinary*                 buildProgram            (const HlslSource& program, glu::ShaderProgramInfo* buildInfo, const tcu::CommandLine& commandLine);
 ProgramBinary*                 assembleProgram         (const vk::SpirVAsmSource& program, SpirVProgramInfo* buildInfo, const tcu::CommandLine& commandLine);
 void                                   disassembleProgram      (const ProgramBinary& program, std::ostream* dst);
-bool                                   validateProgram         (const ProgramBinary& program, std::ostream* dst);
+bool                                   validateProgram         (const ProgramBinary& program, std::ostream* dst, deUint32 vulkanVersion, bool relaxedLayout);
 
 Move<VkShaderModule>   createShaderModule      (const DeviceInterface& deviceInterface, VkDevice device, const ProgramBinary& binary, VkShaderModuleCreateFlags flags);
 
index 1696aaf..c567edf 100644 (file)
@@ -44,16 +44,19 @@ struct ShaderBuildOptions
                FLAG_ALLOW_RELAXED_OFFSETS                              = (1u<<1)       // allow block offsets to follow VK_KHR_relaxed_block_layout
        };
 
+       deUint32                vulkanVersion;
        SpirvVersion    targetVersion;
        deUint32                flags;
 
-       ShaderBuildOptions (SpirvVersion targetVersion_, deUint32 flags_)
-               : targetVersion (targetVersion_)
+       ShaderBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_, deUint32 flags_)
+               : vulkanVersion (vulkanVersion_)
+               , targetVersion (targetVersion_)
                , flags                 (flags_)
        {}
 
        ShaderBuildOptions (void)
-               : targetVersion (SPIRV_VERSION_1_0)
+               : vulkanVersion (VK_MAKE_VERSION(1, 0, 0))
+               , targetVersion (SPIRV_VERSION_1_0)
                , flags                 (0u)
        {}
 };
index 2c2526c..c4d6d90 100644 (file)
@@ -39,6 +39,20 @@ using std::vector;
 
 #if defined(DEQP_HAVE_SPIRV_TOOLS)
 
+// Convert a Vulkan version number to a SPIRV-Tools target environment enum.
+static spv_target_env mapVulkanVersionToSpirvToolsEnv(deUint32 vulkanVersion)
+{
+       switch (vulkanVersion)
+       {
+               case VK_MAKE_VERSION(1, 0, 0): return SPV_ENV_VULKAN_1_0;
+               case VK_MAKE_VERSION(1, 1, 0): return SPV_ENV_VULKAN_1_1;
+               default:
+                       break;
+       }
+       TCU_THROW(InternalError, "Unexpected Vulkan Version version requested");
+       return SPV_ENV_VULKAN_1_0;
+}
+
 static spv_target_env mapTargetSpvEnvironment(SpirvVersion spirvVersion)
 {
        spv_target_env result = SPV_ENV_UNIVERSAL_1_0;
@@ -130,16 +144,20 @@ void disassembleSpirV (size_t binarySizeInWords, const deUint32* binary, std::os
        }
 }
 
-bool validateSpirV (size_t binarySizeInWords, const deUint32* binary, std::ostream* infoLog, SpirvVersion spirvVersion)
+bool validateSpirV (size_t binarySizeInWords, const deUint32* binary, std::ostream* infoLog, deUint32 vulkanVersion, SpirvVersion, bool relaxedLayout)
 {
-       const spv_context       context         = spvContextCreate(mapTargetSpvEnvironment(spirvVersion));
+       const spv_context       context         = spvContextCreate(mapVulkanVersionToSpirvToolsEnv(vulkanVersion));
        spv_diagnostic          diagnostic      = DE_NULL;
 
        try
        {
-               spv_const_binary_t      cbinary         = { binary, binarySizeInWords };
-               const spv_result_t      valid           = spvValidate(context, &cbinary, &diagnostic);
-               const bool                      passed          = (valid == SPV_SUCCESS);
+               spv_const_binary_t              cbinary = { binary, binarySizeInWords };
+
+               spv_validator_options   options = spvValidatorOptionsCreate();
+               spvValidatorOptionsSetRelaxBlockLayout(options, relaxedLayout);
+
+               const spv_result_t              valid   = spvValidateWithOptions(context, options, &cbinary, &diagnostic);
+               const bool                              passed  = (valid == SPV_SUCCESS);
 
                if (diagnostic)
                {
@@ -155,6 +173,7 @@ bool validateSpirV (size_t binarySizeInWords, const deUint32* binary, std::ostre
                        spvTextDestroy(text);
                }
 
+               spvValidatorOptionsDestroy(options);
                spvDiagnosticDestroy(diagnostic);
                spvContextDestroy(context);
 
index 822f1a5..1afcf21 100644 (file)
@@ -38,7 +38,7 @@ bool  assembleSpirV           (const SpirVAsmSource* program, std::vector<deUint32>* dst,
 void   disassembleSpirV        (size_t binarySizeInWords, const deUint32* binary, std::ostream* dst, SpirvVersion spirvVersion);
 
 //! Validate SPIR-V binary, returning true if validation succeeds. Will fail with NotSupportedError if compiler is not available.
-bool   validateSpirV           (size_t binarySizeInWords, const deUint32* binary, std::ostream* infoLog, SpirvVersion spirvVersion);
+bool   validateSpirV           (size_t binarySizeInWords, const deUint32* binary, std::ostream* infoLog, deUint32 vulkanVersion, SpirvVersion spirvVersion, bool relaxedLayout);
 
 } // vk
 
index 94c44a3..d0baba3 100644 (file)
@@ -38,14 +38,17 @@ namespace vk
 
 struct SpirVAsmBuildOptions
 {
+       deUint32        vulkanVersion;
        SpirvVersion    targetVersion;
 
-       SpirVAsmBuildOptions (SpirvVersion targetVersion_)
-               : targetVersion (targetVersion_)
+       SpirVAsmBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_)
+               : vulkanVersion (vulkanVersion_)
+               , targetVersion (targetVersion_)
        {}
 
        SpirVAsmBuildOptions (void)
-               : targetVersion (SPIRV_VERSION_1_0)
+               : vulkanVersion (VK_MAKE_VERSION(1, 0, 0))
+               , targetVersion (SPIRV_VERSION_1_0)
        {}
 };
 
index 947e236..c129c43 100644 (file)
@@ -4058,6 +4058,7 @@ void addGraphics16BitStorageInputOutputFloat16To16Group (tcu::TestCaseGroup* tes
 void addShaderCode16BitStorageInputOutput16To16x2 (vk::SourceCollections& dst, TestDefinition def)
 {
        SpirvVersion                    targetSpirvVersion      = def.instanceContext.resources.spirvVersion;
+       const deUint32                  vulkanVersion           = dst.usedVulkanVersion;
        map<string, string>             spec;
 
        switch(def.dataType)
@@ -4246,8 +4247,8 @@ void addShaderCode16BitStorageInputOutput16To16x2 (vk::SourceCollections& dst, T
                "                             OpReturn\n"
                "                             OpFunctionEnd\n");
 
-       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader.specialize(spec) << SpirVAsmBuildOptions(targetSpirvVersion);
-       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader.specialize(spec) << SpirVAsmBuildOptions(targetSpirvVersion);
+       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader.specialize(spec) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader.specialize(spec) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
 }
 
 TestStatus runAndVerifyDefaultPipeline (Context& context, TestDefinition testDef)
index 679266d..3401fbf 100644 (file)
@@ -364,7 +364,7 @@ SpvAsmComputeShaderCase::SpvAsmComputeShaderCase (tcu::TestContext& testCtx, con
 
 void SpvAsmComputeShaderCase::initPrograms (SourceCollections& programCollection) const
 {
-       programCollection.spirvAsmSources.add("compute") << m_shaderSpec.assembly.c_str() << SpirVAsmBuildOptions(m_shaderSpec.spirvVersion);
+       programCollection.spirvAsmSources.add("compute") << m_shaderSpec.assembly.c_str() << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, m_shaderSpec.spirvVersion);
 }
 
 TestInstance* SpvAsmComputeShaderCase::createInstance (Context& ctx) const
index 91b0a9c..99f255d 100644 (file)
@@ -1234,6 +1234,7 @@ map<string, string> passthruFragments (void)
 // Vertex shader gets custom code from context, the rest are pass-through.
 void addShaderCodeCustomVertex (vk::SourceCollections& dst, InstanceContext& context, const SpirVAsmBuildOptions* spirVAsmBuildOptions)
 {
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
        SpirvVersion targetSpirvVersion;
 
        if (spirVAsmBuildOptions == DE_NULL)
@@ -1246,13 +1247,13 @@ void addShaderCodeCustomVertex (vk::SourceCollections& dst, InstanceContext& con
                // Inject boilerplate code to wire up additional input/output variables between stages.
                // Just copy the contents in input variable to output variable in all stages except
                // the customized stage.
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        } else {
                map<string, string> passthru = passthruFragments();
 
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
 }
 
@@ -1266,6 +1267,7 @@ void addShaderCodeCustomVertex (vk::SourceCollections& dst, InstanceContext cont
 // pass-through.
 void addShaderCodeCustomTessControl (vk::SourceCollections& dst, InstanceContext& context, const SpirVAsmBuildOptions* spirVAsmBuildOptions)
 {
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
        SpirvVersion targetSpirvVersion;
 
        if (spirVAsmBuildOptions == DE_NULL)
@@ -1278,19 +1280,19 @@ void addShaderCodeCustomTessControl (vk::SourceCollections& dst, InstanceContext
                // Inject boilerplate code to wire up additional input/output variables between stages.
                // Just copy the contents in input variable to output variable in all stages except
                // the customized stage.
-               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << StringTemplate(makeTessControlShaderAssembly(fillInterfacePlaceholderTessCtrl())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << StringTemplate(makeTessEvalShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << StringTemplate(makeTessControlShaderAssembly(fillInterfacePlaceholderTessCtrl())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << StringTemplate(makeTessEvalShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
        else
        {
                map<string, string> passthru = passthruFragments();
 
-               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << makeTessControlShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << makeTessEvalShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << makeTessControlShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << makeTessEvalShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
 }
 
@@ -1304,6 +1306,7 @@ void addShaderCodeCustomTessControl (vk::SourceCollections& dst, InstanceContext
 // pass-through.
 void addShaderCodeCustomTessEval (vk::SourceCollections& dst, InstanceContext& context, const SpirVAsmBuildOptions* spirVAsmBuildOptions)
 {
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
        SpirvVersion targetSpirvVersion;
 
        if (spirVAsmBuildOptions == DE_NULL)
@@ -1316,18 +1319,18 @@ void addShaderCodeCustomTessEval (vk::SourceCollections& dst, InstanceContext& c
                // Inject boilerplate code to wire up additional input/output variables between stages.
                // Just copy the contents in input variable to output variable in all stages except
                // the customized stage.
-               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << StringTemplate(makeTessControlShaderAssembly(fillInterfacePlaceholderTessCtrl())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << StringTemplate(makeTessEvalShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << StringTemplate(makeTessControlShaderAssembly(fillInterfacePlaceholderTessCtrl())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << StringTemplate(makeTessEvalShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
        else
        {
                map<string, string> passthru = passthruFragments();
-               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << makeTessControlShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << makeTessEvalShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert",  spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tessc", spirVAsmBuildOptions) << makeTessControlShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("tesse", spirVAsmBuildOptions) << makeTessEvalShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag",  spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
 }
 
@@ -1340,6 +1343,7 @@ void addShaderCodeCustomTessEval (vk::SourceCollections& dst, InstanceContext co
 // Geometry shader gets custom code from context, the rest are pass-through.
 void addShaderCodeCustomGeometry (vk::SourceCollections& dst, InstanceContext& context, const SpirVAsmBuildOptions* spirVAsmBuildOptions)
 {
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
        SpirvVersion targetSpirvVersion;
 
        if (spirVAsmBuildOptions == DE_NULL)
@@ -1352,16 +1356,16 @@ void addShaderCodeCustomGeometry (vk::SourceCollections& dst, InstanceContext& c
                // Inject boilerplate code to wire up additional input/output variables between stages.
                // Just copy the contents in input variable to output variable in all stages except
                // the customized stage.
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("geom", spirVAsmBuildOptions) << StringTemplate(makeGeometryShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("geom", spirVAsmBuildOptions) << StringTemplate(makeGeometryShaderAssembly(fillInterfacePlaceholderTessEvalGeom())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(passthruInterface(context.interfaces.getOutputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
        else
        {
                map<string, string> passthru = passthruFragments();
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("geom", spirVAsmBuildOptions) << makeGeometryShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("geom", spirVAsmBuildOptions) << makeGeometryShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
 }
 
@@ -1374,6 +1378,7 @@ void addShaderCodeCustomGeometry (vk::SourceCollections& dst, InstanceContext co
 // Fragment shader gets custom code from context, the rest are pass-through.
 void addShaderCodeCustomFragment (vk::SourceCollections& dst, InstanceContext& context, const SpirVAsmBuildOptions* spirVAsmBuildOptions)
 {
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
        SpirvVersion targetSpirvVersion;
 
        if (spirVAsmBuildOptions == DE_NULL)
@@ -1386,14 +1391,14 @@ void addShaderCodeCustomFragment (vk::SourceCollections& dst, InstanceContext& c
                // Inject boilerplate code to wire up additional input/output variables between stages.
                // Just copy the contents in input variable to output variable in all stages except
                // the customized stage.
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << StringTemplate(makeVertexShaderAssembly(fillInterfacePlaceholderVert())).specialize(passthruInterface(context.interfaces.getInputType())) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << StringTemplate(makeFragmentShaderAssembly(fillInterfacePlaceholderFrag())).specialize(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
        else
        {
                map<string, string> passthru = passthruFragments();
-               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(targetSpirvVersion);
-               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(targetSpirvVersion);
+               dst.spirvAsmSources.add("vert", spirVAsmBuildOptions) << makeVertexShaderAssembly(passthru) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+               dst.spirvAsmSources.add("frag", spirVAsmBuildOptions) << makeFragmentShaderAssembly(context.testCodeFragments) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
        }
 }
 
index 0707881..581a3eb 100644 (file)
@@ -204,7 +204,7 @@ void SpvAsmLoopControlDependencyInfiniteCase::initPrograms (SourceCollections& p
 
        getComputeSourceCode(comp);
 
-       programCollection.spirvAsmSources.add("compute") << SpirVAsmBuildOptions(SPIRV_VERSION_1_3) << comp;
+       programCollection.spirvAsmSources.add("compute") << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3) << comp;
 }
 
 TestInstance* SpvAsmLoopControlDependencyInfiniteCase::createInstance (Context& context) const
index 8bc6e27..b4a6049 100644 (file)
@@ -219,7 +219,7 @@ void SpvAsmLoopControlDependencyLengthCase::initPrograms (SourceCollections& pro
 
        getComputeSourceCode(comp);
 
-       programCollection.spirvAsmSources.add("compute") << SpirVAsmBuildOptions(SPIRV_VERSION_1_3) << comp;
+       programCollection.spirvAsmSources.add("compute") << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3) << comp;
 }
 
 TestInstance* SpvAsmLoopControlDependencyLengthCase::createInstance (Context& context) const
index 72b9f8d..a9e0339 100644 (file)
@@ -268,7 +268,7 @@ void validateVulkanVersion (const deUint32 usedVulkanVersion, const SpirvVersion
 
 void SpvAsmSpirvVersionsCase::initPrograms (SourceCollections& programCollection) const
 {
-       const SpirVAsmBuildOptions      spirVAsmBuildOptions    (m_testParameters.spirvVersion);
+       const SpirVAsmBuildOptions      spirVAsmBuildOptions    (programCollection.usedVulkanVersion, m_testParameters.spirvVersion);
 
        validateVulkanVersion(programCollection.usedVulkanVersion, m_testParameters.spirvVersion);
 
index 7b50c63..3388973 100644 (file)
@@ -394,8 +394,9 @@ void addShaderCodeOutput(vk::SourceCollections& dst, InstanceContext& context, s
 
        spec["type"] = type;
 
-       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader.specialize(spec) << SpirVAsmBuildOptions(targetSpirvVersion);
-       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader.specialize(spec) << SpirVAsmBuildOptions(targetSpirvVersion);
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
+       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader.specialize(spec) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader.specialize(spec) << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
 }
 
 void addShaderCodeOutputFloat (vk::SourceCollections& dst, InstanceContext context)
@@ -540,8 +541,9 @@ void addShaderCodeOutputStruct (vk::SourceCollections& dst, InstanceContext cont
                "                            OpReturn\n"
                "                            OpFunctionEnd\n";
 
-       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader << SpirVAsmBuildOptions(targetSpirvVersion);
-       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader << SpirVAsmBuildOptions(targetSpirvVersion);
+       const deUint32 vulkanVersion = dst.usedVulkanVersion;
+       dst.spirvAsmSources.add("vert", DE_NULL) << vertexShader << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
+       dst.spirvAsmSources.add("frag", DE_NULL) << fragmentShader << SpirVAsmBuildOptions(vulkanVersion, targetSpirvVersion);
 }
 
 void addGraphicsVariableInitOutputTest (tcu::TestCaseGroup* group)
index e2f46d1..baaad7c 100644 (file)
@@ -2275,7 +2275,7 @@ void SSBOLayoutCase::initPrograms (vk::SourceCollections& programCollection) con
        if (usesRelaxedLayout(m_interface))
        {
                programCollection.glslSources.add("compute") << glu::ComputeSource(m_computeShaderSrc)
-                       << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_0, vk::ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS);
+                       << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_0, vk::ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS);
        }
        else
                programCollection.glslSources.add("compute") << glu::ComputeSource(m_computeShaderSrc);
index b0cf53e..04d10df 100755 (executable)
@@ -449,7 +449,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::string                                             indexVars;
        std::ostringstream                              bdy;
 
@@ -718,7 +718,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -747,7 +747,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_PointSize = 1.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("vert")
-                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -778,7 +778,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                "}\n";
                        programCollection.glslSources.add("tesc")
-                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -805,7 +805,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("tese")
-                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -833,7 +833,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EmitVertex();\n"
                                "  EndPrimitive();\n"
                                "}\n";
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -854,7 +854,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  result = tempResult;\n"
                                "}\n";
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                subgroups::addNoSubgroupShader(programCollection);
        }
index c9f41a1..576d4a4 100755 (executable)
@@ -194,7 +194,7 @@ std::string getBodySource(CaseDefinition caseDef)
 
 void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
 
@@ -341,7 +341,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -453,15 +453,15 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                subgroups::addNoSubgroupShader(programCollection);
 
                programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tesc")
-                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tese")
-                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
-               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
+               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                  programCollection.glslSources);
                programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
 }
 
index d3c232c..5485427 100755 (executable)
@@ -294,7 +294,7 @@ std::string getBodySource(CaseDefinition caseDef)
 
 void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
 
@@ -419,7 +419,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -511,15 +511,15 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                subgroups::addNoSubgroupShader(programCollection);
 
                programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tesc")
-                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tese")
-                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
-               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
+               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                  programCollection.glslSources);
                programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
 }
 
index 3384ae3..163927d 100755 (executable)
@@ -113,7 +113,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::SpirVAsmBuildOptions  buildOptionsSpr (vk::SPIRV_VERSION_1_3);
+       const vk::SpirVAsmBuildOptions  buildOptionsSpr (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3);
        std::ostringstream                              subgroupSizeStr;
        subgroupSizeStr << subgroups::maxSupportedSubgroupSize();
 
@@ -792,7 +792,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -924,15 +924,15 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                subgroups::addNoSubgroupShader(programCollection);
 
                programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tesc")
-                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                programCollection.glslSources.add("tese")
-                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
-               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
+               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                  programCollection.glslSources);
                programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
 }
 
index b899fe4..db75fa8 100755 (executable)
@@ -327,8 +327,8 @@ struct CaseDefinition
 
 void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
-       const vk::SpirVAsmBuildOptions  buildOptionsSpr (vk::SPIRV_VERSION_1_3);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
+       const vk::SpirVAsmBuildOptions  buildOptionsSpr (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3);
 
        if(VK_SHADER_STAGE_FRAGMENT_BIT != caseDef.shaderStage)
        {
@@ -1417,7 +1417,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                << "}\n";
 
                        programCollection.glslSources.add("comp")
-                                       << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                else
                {
@@ -1451,7 +1451,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                                << "  gl_PointSize = 1.0f;\n"
                                                << "}\n";
                                programCollection.glslSources.add("vert")
-                                       << glu::VertexSource(vertex.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::VertexSource(vertex.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1487,7 +1487,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                                << "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                                << "}\n";
                                programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1519,7 +1519,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                                << "  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                                << "}\n";
                                programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1552,7 +1552,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                                        << "  EmitVertex();\n"
                                                        << "  EndPrimitive();\n"
                                                        << "}\n";
-                               subgroups::addGeometryShadersFromTemplate(geometry.str(), vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                               subgroups::addGeometryShadersFromTemplate(geometry.str(), vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                                  programCollection.glslSources);
                        }
 
@@ -1579,7 +1579,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                                        << "  }\n"
                                                        << "}\n";
                                programCollection.glslSources.add("fragment")
-                                       << glu::FragmentSource(fragment.str())<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::FragmentSource(fragment.str())<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
                        subgroups::addNoSubgroupShader(programCollection);
                }
@@ -1660,7 +1660,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                << "}\n";
 
                        programCollection.glslSources.add("comp")
-                                       << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                else
                {
@@ -1704,7 +1704,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                        "  gl_PointSize = 1.0f;\n"
                                        "}\n";
                                programCollection.glslSources.add("vert")
-                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1750,7 +1750,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                        "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                        "}\n";
                                programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1791,7 +1791,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                        "  float pixelSize = 2.0f/1024.0f;\n""  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                        "}\n";
                                programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                        {
@@ -1834,7 +1834,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                        "  EmitVertex();\n"
                                        "  EndPrimitive();\n"
                                        "}\n";
-                               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                               subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                                  programCollection.glslSources);
                        }
 
@@ -1872,7 +1872,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                        "  result = tempResult;\n"
                                        "}\n";
                                programCollection.glslSources.add("fragment")
-                                       << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                        }
 
                subgroups::addNoSubgroupShader(programCollection);
index ef3ffd5..9d0c220 100755 (executable)
@@ -274,7 +274,7 @@ std::string subgroupMask (const CaseDefinition& caseDef)
 
 void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::SpirVAsmBuildOptions  buildOptionsSpr (vk::SPIRV_VERSION_1_3);
+       const vk::SpirVAsmBuildOptions  buildOptionsSpr (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3);
        const string                                    comparison              = subgroupComparison(caseDef);
        const string                                    mask                    = varSubgroupMask(caseDef);
 
@@ -1274,7 +1274,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -1297,7 +1297,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_PointSize = 1.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -1322,7 +1322,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                "}\n";
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -1344,7 +1344,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -1367,7 +1367,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EndPrimitive();\n"
                                "}\n";
 
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -1383,7 +1383,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                subgroups::addNoSubgroupShader(programCollection);
index 31a03de..b825a74 100755 (executable)
@@ -321,8 +321,8 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
-       const vk::SpirVAsmBuildOptions  buildOptionsSpr (vk::SPIRV_VERSION_1_3);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
+       const vk::SpirVAsmBuildOptions  buildOptionsSpr (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3);
 
        {
                /*
@@ -978,7 +978,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -1088,7 +1088,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "OpStore %54 %34\n"
                                "OpReturn\n"
                                "OpFunctionEnd\n";
-                               programCollection.spirvAsmSources.add("vert") << vertex << SpirVAsmBuildOptions(SPIRV_VERSION_1_3);
+                               programCollection.spirvAsmSources.add("vert") << vertex << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3);
                }
 
                {
@@ -1217,7 +1217,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "OpStore %60 %58\n"
                                "OpReturn\n"
                                "OpFunctionEnd\n";
-                               programCollection.spirvAsmSources.add("tesc") << tesc << SpirVAsmBuildOptions(SPIRV_VERSION_1_3);
+                               programCollection.spirvAsmSources.add("tesc") << tesc << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3);
                }
 
                {
@@ -1344,7 +1344,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "OpStore %66 %64\n"
                                "OpReturn\n"
                                "OpFunctionEnd\n";
-                               programCollection.spirvAsmSources.add("tese") << tese << SpirVAsmBuildOptions(SPIRV_VERSION_1_3);
+                               programCollection.spirvAsmSources.add("tese") << tese << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3);
                }
 
                {
@@ -1450,7 +1450,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        "OpEndPrimitive\n"
                        "OpReturn\n"
                        "OpFunctionEnd\n";
-                       addGeometryShadersFromTemplate(geometry, SpirVAsmBuildOptions(SPIRV_VERSION_1_3), programCollection.spirvAsmSources);
+                       addGeometryShadersFromTemplate(geometry, SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3), programCollection.spirvAsmSources);
                }
 
                {
@@ -1503,7 +1503,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        "OpReturn\n"
                        "OpFunctionEnd\n";
 
-                       programCollection.spirvAsmSources.add("fragment") << fragment << SpirVAsmBuildOptions(SPIRV_VERSION_1_3);
+                       programCollection.spirvAsmSources.add("fragment") << fragment << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3);
                }
 
                subgroups::addNoSubgroupShader(programCollection);
index cb4491e..d71699c 100755 (executable)
@@ -371,7 +371,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::ostringstream                              bdy;
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
@@ -594,7 +594,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -623,7 +623,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -655,7 +655,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        "}\n";
 
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -682,7 +682,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -710,7 +710,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EmitVertex();\n"
                                "  EndPrimitive();\n"
                                "}\n";
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u), programCollection.glslSources);
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u), programCollection.glslSources);
                }
 
                {
@@ -730,7 +730,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  result = tempResult ? 1 : 0;\n"
                                "}\n";
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                subgroups::addNoSubgroupShader(programCollection);
index 39612ff..c1a658a 100755 (executable)
@@ -487,7 +487,7 @@ string getTestString(const CaseDefinition &caseDef)
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::ostringstream                              bdy;
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
@@ -650,7 +650,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -680,7 +680,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_PointSize = 1.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("vert")
-                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -712,7 +712,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                "}\n";
                        programCollection.glslSources.add("tesc")
-                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -740,7 +740,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("tese")
-                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -769,7 +769,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EmitVertex();\n"
                                "  EndPrimitive();\n"
                                "}\n";
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -791,7 +791,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  result = tempResult;\n"
                                "}\n";
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                subgroups::addNoSubgroupShader(programCollection);
        }
index dd528bc..cb4fd73 100755 (executable)
@@ -143,7 +143,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::string                     swapTable[OPTYPE_LAST];
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
@@ -415,7 +415,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -466,7 +466,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_Position = vec4(float(gl_VertexIndex) * pixelSize + pixelPosition, 0.0f, 0.0f, 1.0f);\n"
                                "}\n";
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -505,7 +505,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
                                "}\n";
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -540,7 +540,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -576,7 +576,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EmitVertex();\n"
                                "  EndPrimitive();\n"
                                "}\n";
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -605,7 +605,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  }\n"
                                "}\n";
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                subgroups::addNoSubgroupShader(programCollection);
        }
index 5ab67da..7c11e13 100755 (executable)
@@ -134,7 +134,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::ostringstream                              bdy;
        std::string                                             extension = (OPTYPE_CLUSTERED == caseDef.opType) ?
                                                                                "#extension GL_KHR_shader_subgroup_clustered: enable\n" :
@@ -373,7 +373,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -396,7 +396,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -422,7 +422,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -444,7 +444,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -467,7 +467,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EndPrimitive();\n"
                                "}\n";
 
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -483,7 +483,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
                subgroups::addNoSubgroupShader(programCollection);
        }
index 4a80ba8..1e2c8ef 100755 (executable)
@@ -142,7 +142,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions    buildOptions    (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions    buildOptions    (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        std::string                                             idTable[OPTYPE_LAST];
 
        subgroups::setFragmentShaderFrameBuffer(programCollection);
@@ -427,7 +427,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                        << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -476,7 +476,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -521,7 +521,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -562,7 +562,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -604,7 +604,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EndPrimitive();\n"
                                "}\n";
 
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
                {
@@ -638,7 +638,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                subgroups::addNoSubgroupShader(programCollection);
index 077b848..7b706e6 100755 (executable)
@@ -219,7 +219,7 @@ struct CaseDefinition
 
 void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefinition caseDef)
 {
-       const vk::ShaderBuildOptions buildOptions       (vk::SPIRV_VERSION_1_3, 0u);
+       const vk::ShaderBuildOptions buildOptions       (programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
 
        if (VK_SHADER_STAGE_FRAGMENT_BIT != caseDef.shaderStage)
                subgroups::setFragmentShaderFrameBuffer(programCollection);
@@ -233,7 +233,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti
                        "  gl_Position = vec4(uv * 4.0f -2.0f, 0.0f, 1.0f);\n"
                        "  gl_PointSize = 1.0f;\n"
                        "}\n";
-               programCollection.glslSources.add("vert") << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+               programCollection.glslSources.add("vert") << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else if (VK_SHADER_STAGE_VERTEX_BIT != caseDef.shaderStage)
                subgroups::setVertexShaderFrameBuffer(programCollection);
@@ -288,7 +288,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti
                        << "  gl_PointSize = 1.0f;\n"
                        << "}\n";
 
-               programCollection.glslSources.add("vert") << glu::VertexSource(vertexSrc.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+               programCollection.glslSources.add("vert") << glu::VertexSource(vertexSrc.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else if (VK_SHADER_STAGE_GEOMETRY_BIT == caseDef.shaderStage)
        {
@@ -429,7 +429,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti
                << "}\n";
 
                programCollection.glslSources.add("fragment")
-                       << glu::FragmentSource(fragmentSource.str())<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                       << glu::FragmentSource(fragmentSource.str())<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -501,7 +501,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                src << "}\n";
 
                programCollection.glslSources.add("comp")
-                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::ComputeSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
        }
        else
        {
@@ -559,7 +559,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  gl_PointSize = 1.0f;\n"
                                "}\n";
                        programCollection.glslSources.add("vert")
-                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::VertexSource(vertex) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -589,7 +589,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tesc")
-                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -615,7 +615,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("tese")
-                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                                       << glu::TessellationEvaluationSource(tese) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                {
@@ -642,7 +642,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "  EndPrimitive();\n"
                                "}\n";
 
-                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u),
+                       subgroups::addGeometryShadersFromTemplate(geometry, vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u),
                                                                                                          programCollection.glslSources);
                }
 
@@ -689,7 +689,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
                                "}\n";
 
                        programCollection.glslSources.add("fragment")
-                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(vk::SPIRV_VERSION_1_3, 0u);
+                               << glu::FragmentSource(fragment)<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u);
                }
 
                subgroups::addNoSubgroupShader(programCollection);
index 5abccdd..a0fd14b 100644 (file)
@@ -201,19 +201,25 @@ struct Program
        Status                                  validationStatus;
        std::string                             validationLog;
 
+       deUint32                                vulkanVersion;  // Target Vulkan environment.
        vk::SpirvVersion                spirvVersion;
+       bool                                    relaxedLayout;  // Uses VK_KHR_relaxed_block_layout?
 
-       explicit                                Program         (const vk::ProgramIdentifier& id_, const vk::SpirvVersion spirvVersion_)
+       explicit                                Program         (const vk::ProgramIdentifier& id_, deUint32 vulkanVersion_, const vk::SpirvVersion spirvVersion_, const bool relaxedLayout_)
                                                                : id                            (id_)
                                                                , buildStatus           (STATUS_NOT_COMPLETED)
                                                                , validationStatus      (STATUS_NOT_COMPLETED)
+                                                               , vulkanVersion         (vulkanVersion_)
                                                                , spirvVersion          (spirvVersion_)
+                                                               , relaxedLayout         (relaxedLayout_)
                                                        {}
                                                        Program         (void)
                                                                : id                            ("", "")
                                                                , buildStatus           (STATUS_NOT_COMPLETED)
                                                                , validationStatus      (STATUS_NOT_COMPLETED)
+                                                               , vulkanVersion         (VK_MAKE_VERSION(1, 0, 0))
                                                                , spirvVersion          (vk::SPIRV_VERSION_LAST)
+                                                               , relaxedLayout         (false)
                                                        {}
 };
 
@@ -266,8 +272,9 @@ public:
                {
                        DE_ASSERT(m_source.buildOptions.targetVersion < vk::SPIRV_VERSION_LAST);
                        DE_ASSERT(m_commandLine != DE_NULL);
-                       m_program->binary               = ProgramBinarySp(vk::buildProgram(m_source, &buildInfo, *m_commandLine));
-                       m_program->buildStatus  = Program::STATUS_PASSED;
+                       m_program->binary                       = ProgramBinarySp(vk::buildProgram(m_source, &buildInfo, *m_commandLine));
+                       m_program->buildStatus          = Program::STATUS_PASSED;
+                       m_program->relaxedLayout        = m_source.buildOptions.flags & vk::ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS;
                }
                catch (const tcu::Exception&)
                {
@@ -354,7 +361,7 @@ public:
 
                std::ostringstream                      validationLogStream;
 
-               if (vk::validateProgram(*m_program->binary, &validationLogStream))
+               if (vk::validateProgram(*m_program->binary, &validationLogStream, m_program->vulkanVersion, m_program->relaxedLayout))
                        m_program->validationStatus = Program::STATUS_PASSED;
                else
                        m_program->validationStatus = Program::STATUS_FAILED;
@@ -424,9 +431,9 @@ BuildStats buildPrograms (tcu::TestContext&                 testCtx,
                                {
                                        const TestCase* const           testCase                                        = dynamic_cast<TestCase*>(iterator.getNode());
                                        const string                            casePath                                        = iterator.getNodePath();
-                                       vk::ShaderBuildOptions          defaultGlslBuildOptions         (baselineSpirvVersion, 0u);
-                                       vk::ShaderBuildOptions          defaultHlslBuildOptions         (baselineSpirvVersion, 0u);
-                                       vk::SpirVAsmBuildOptions        defaultSpirvAsmBuildOptions     (baselineSpirvVersion);
+                                       vk::ShaderBuildOptions          defaultGlslBuildOptions         (usedVulkanVersion, baselineSpirvVersion, 0u);
+                                       vk::ShaderBuildOptions          defaultHlslBuildOptions         (usedVulkanVersion, baselineSpirvVersion, 0u);
+                                       vk::SpirVAsmBuildOptions        defaultSpirvAsmBuildOptions     (usedVulkanVersion, baselineSpirvVersion);
                                        vk::SourceCollections           sourcePrograms                          (usedVulkanVersion, defaultGlslBuildOptions, defaultHlslBuildOptions, defaultSpirvAsmBuildOptions);
 
                                        try
@@ -448,7 +455,8 @@ BuildStats buildPrograms (tcu::TestContext&                 testCtx,
                                                if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
                                                        continue;
 
-                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.targetVersion));
+                                               const bool relaxedLayout = progIter.getProgram().buildOptions.flags & vk::ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS;
+                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.vulkanVersion, progIter.getProgram().buildOptions.targetVersion, relaxedLayout));
                                                buildGlslTasks.pushBack(BuildHighLevelShaderTask<vk::GlslSource>(progIter.getProgram(), &programs.back()));
                                                buildGlslTasks.back().setCommandline(testCtx.getCommandLine());
                                                executor.submit(&buildGlslTasks.back());
@@ -462,7 +470,8 @@ BuildStats buildPrograms (tcu::TestContext&                 testCtx,
                                                if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
                                                        continue;
 
-                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.targetVersion));
+                                               const bool relaxedLayout = progIter.getProgram().buildOptions.flags & vk::ShaderBuildOptions::FLAG_ALLOW_RELAXED_OFFSETS;
+                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.vulkanVersion, progIter.getProgram().buildOptions.targetVersion, relaxedLayout));
                                                buildHlslTasks.pushBack(BuildHighLevelShaderTask<vk::HlslSource>(progIter.getProgram(), &programs.back()));
                                                buildHlslTasks.back().setCommandline(testCtx.getCommandLine());
                                                executor.submit(&buildHlslTasks.back());
@@ -476,7 +485,7 @@ BuildStats buildPrograms (tcu::TestContext&                 testCtx,
                                                if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
                                                        continue;
 
-                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.targetVersion));
+                                               programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.vulkanVersion, progIter.getProgram().buildOptions.targetVersion, false));
                                                buildSpirvAsmTasks.pushBack(BuildSpirVAsmTask(progIter.getProgram(), &programs.back()));
                                                buildSpirvAsmTasks.back().setCommandline(testCtx.getCommandLine());
                                                executor.submit(&buildSpirvAsmTasks.back());
index 4994a47..c0f9a30 100644 (file)
@@ -229,9 +229,9 @@ void TestCaseExecutor::init (tcu::TestCase* testCase, const std::string& casePat
        tcu::TestLog&                           log                                                     = m_context.getTestContext().getLog();
        const deUint32                          usedVulkanVersion                       = m_context.getUsedApiVersion();
        const vk::SpirvVersion          baselineSpirvVersion            = vk::getBaselineSpirvVersion(usedVulkanVersion);
-       vk::ShaderBuildOptions          defaultGlslBuildOptions         (baselineSpirvVersion, 0u);
-       vk::ShaderBuildOptions          defaultHlslBuildOptions         (baselineSpirvVersion, 0u);
-       vk::SpirVAsmBuildOptions        defaultSpirvAsmBuildOptions     (baselineSpirvVersion);
+       vk::ShaderBuildOptions          defaultGlslBuildOptions         (usedVulkanVersion, baselineSpirvVersion, 0u);
+       vk::ShaderBuildOptions          defaultHlslBuildOptions         (usedVulkanVersion, baselineSpirvVersion, 0u);
+       vk::SpirVAsmBuildOptions        defaultSpirvAsmBuildOptions     (usedVulkanVersion, baselineSpirvVersion);
        vk::SourceCollections           sourceProgs                                     (usedVulkanVersion, defaultGlslBuildOptions, defaultHlslBuildOptions, defaultSpirvAsmBuildOptions);
        const bool                                      doShaderLog                                     = log.isShaderLoggingEnabled();
        const tcu::CommandLine&         commandLine                                     = m_context.getTestContext().getCommandLine();