deUint32 vulkanVersion;
SpirvVersion targetVersion;
deUint32 flags;
+ bool supports_VK_KHR_spirv_1_4;
- ShaderBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_, deUint32 flags_)
+ ShaderBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_, deUint32 flags_, bool allowSpirv14 = false)
: vulkanVersion (vulkanVersion_)
, targetVersion (targetVersion_)
, flags (flags_)
+ , supports_VK_KHR_spirv_1_4(allowSpirv14)
{}
ShaderBuildOptions (void)
: vulkanVersion (VK_MAKE_VERSION(1, 0, 0))
, targetVersion (SPIRV_VERSION_1_0)
, flags (0u)
+ , supports_VK_KHR_spirv_1_4 (false)
{}
SpirvValidatorOptions getSpirvValidatorOptions() const
rules = SpirvValidatorOptions::kRelaxedBlockLayout;
}
- return SpirvValidatorOptions(vulkanVersion, rules);
+ return SpirvValidatorOptions(vulkanVersion, rules, supports_VK_KHR_spirv_1_4);
}
};
kScalarBlockLayout
};
- SpirvValidatorOptions(deUint32 the_vulkan_version = VK_MAKE_VERSION(1, 0, 0), BlockLayoutRules the_layout = kDefaultBlockLayout)
- : vulkanVersion(the_vulkan_version), blockLayout(the_layout), supports_VK_KHR_spirv_1_4(false) {}
+ SpirvValidatorOptions(deUint32 the_vulkan_version = VK_MAKE_VERSION(1, 0, 0), BlockLayoutRules the_layout = kDefaultBlockLayout, bool allowSpirv14 = false)
+ : vulkanVersion(the_vulkan_version), blockLayout(the_layout), supports_VK_KHR_spirv_1_4(allowSpirv14) {}
// The target Vulkan version. This determines the SPIR-V environment rules to
// be checked. The bit pattern is as produced by VK_MAKE_VERSION.
const bool validateBinaries,
const deUint32 usedVulkanVersion,
const vk::SpirvVersion baselineSpirvVersion,
- const vk::SpirvVersion maxSpirvVersion)
+ const vk::SpirvVersion maxSpirvVersion,
+ const bool allowSpirV14)
{
const deUint32 numThreads = deGetNumAvailableLogicalCores();
++progIter)
{
// Source program requires higher SPIR-V version than available: skip it to avoid fail
- if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
+ // Unless this is SPIR-V 1.4 and is explicitly allowed.
+ if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion && !(allowSpirV14 && progIter.getProgram().buildOptions.supports_VK_KHR_spirv_1_4 && progIter.getProgram().buildOptions.targetVersion == vk::SPIRV_VERSION_1_4))
continue;
programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.getSpirvValidatorOptions()));
++progIter)
{
// Source program requires higher SPIR-V version than available: skip it to avoid fail
- if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
+ // Unless this is SPIR-V 1.4 and is explicitly allowed.
+ if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion && !(allowSpirV14 && progIter.getProgram().buildOptions.supports_VK_KHR_spirv_1_4 && progIter.getProgram().buildOptions.targetVersion == vk::SPIRV_VERSION_1_4))
continue;
programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.getSpirvValidatorOptions()));
++progIter)
{
// Source program requires higher SPIR-V version than available: skip it to avoid fail
- if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion)
+ // Unless this is SPIR-V 1.4 and is explicitly allowed.
+ if (progIter.getProgram().buildOptions.targetVersion > maxSpirvVersion && !(allowSpirV14 && progIter.getProgram().buildOptions.supports_VK_KHR_spirv_1_4 && progIter.getProgram().buildOptions.targetVersion == vk::SPIRV_VERSION_1_4))
continue;
programs.pushBack(Program(vk::ProgramIdentifier(casePath, progIter.getName()), progIter.getProgram().buildOptions.getSpirvValidatorOptions()));
DE_DECLARE_COMMAND_LINE_OPT(ShaderCacheTruncate, bool);
DE_DECLARE_COMMAND_LINE_OPT(SpirvOptimize, bool);
DE_DECLARE_COMMAND_LINE_OPT(SpirvOptimizationRecipe,std::string);
+DE_DECLARE_COMMAND_LINE_OPT(SpirvAllow14, bool);
static const de::cmdline::NamedValue<bool> s_enableNames[] =
{
<< Option<opt::ShaderCacheFilename>("r", "shadercache-filename", "Write shader cache to given file", "shadercache.bin")
<< Option<opt::ShaderCacheTruncate>("x", "shadercache-truncate", "Truncate shader cache before running", s_enableNames, "enable")
<< Option<opt::SpirvOptimize>("o", "deqp-optimize-spirv", "Enable optimization for SPIR-V", s_enableNames, "disable")
- << Option<opt::SpirvOptimizationRecipe>("p","deqp-optimization-recipe", "Shader optimization recipe");
+ << Option<opt::SpirvOptimizationRecipe>("p","deqp-optimization-recipe", "Shader optimization recipe")
+ << Option<opt::SpirvAllow14>("e","allow-spirv-14", "Allow SPIR-V 1.4 with Vulkan 1.1");
}
} // opt
cmdLine.getOption<opt::Validate>(),
cmdLine.getOption<opt::VulkanVersion>(),
baselineSpirvVersion,
- maxSpirvVersion);
+ maxSpirvVersion,
+ cmdLine.getOption<opt::SpirvAllow14>());
tcu::print("DONE: %d passed, %d failed, %d not supported\n", stats.numSucceeded, stats.numFailed, stats.notSupported);