SPV: Add option for controling when the SPIRV-Tools validator is used.
This commit is contained in:
@@ -7015,7 +7015,8 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
|
||||
it.dumpSpv(spirv);
|
||||
|
||||
#if ENABLE_OPT
|
||||
SpirvToolsValidate(intermediate, spirv, logger);
|
||||
if (options->validate)
|
||||
SpirvToolsValidate(intermediate, spirv, logger);
|
||||
|
||||
// If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan
|
||||
// eg. forward and remove memory writes of opaque types.
|
||||
|
||||
@@ -51,11 +51,12 @@ namespace glslang {
|
||||
|
||||
struct SpvOptions {
|
||||
SpvOptions() : generateDebugInfo(false), disableOptimizer(true),
|
||||
optimizeSize(false), disassemble(false) { }
|
||||
optimizeSize(false), disassemble(false), validate(false) { }
|
||||
bool generateDebugInfo;
|
||||
bool disableOptimizer;
|
||||
bool optimizeSize;
|
||||
bool disassemble;
|
||||
bool validate;
|
||||
};
|
||||
|
||||
#if ENABLE_OPT
|
||||
|
||||
Reference in New Issue
Block a user