diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang-glslang/slang-glslang.cpp | 25 | ||||
| -rw-r--r-- | source/slang/hlsl.meta.slang | 2 |
2 files changed, 13 insertions, 14 deletions
diff --git a/source/slang-glslang/slang-glslang.cpp b/source/slang-glslang/slang-glslang.cpp index e89581740..6cb6db995 100644 --- a/source/slang-glslang/slang-glslang.cpp +++ b/source/slang-glslang/slang-glslang.cpp @@ -399,14 +399,18 @@ static void glslang_optimizeSPIRV(spv_target_env targetEnv, const glslang_Compil spvOptOptions.set_run_validator(false); // Don't run the validator by default - // Put the output optimized spirv into optSpirv - std::vector<unsigned int> optSpirv; - - // Optimize - optimizer.Run(ioSpirv.data(), ioSpirv.size(), &optSpirv, spvOptOptions); + { + // Put the output optimized spirv into optSpirv + std::vector<unsigned int> optSpirv; - // Make the ioSpirv the optimized spirv - ioSpirv.swap(optSpirv); + // Optimize + if (optimizer.Run(ioSpirv.data(), ioSpirv.size(), &optSpirv, spvOptOptions)) + { + assert(optSpirv.size() > 0); + // Make the ioSpirv the optimized spirv + ioSpirv.swap(optSpirv); + } + } } static glslang::EShTargetLanguageVersion _makeTargetLanguageVersion(int majorVersion, int minorVersion) @@ -636,13 +640,6 @@ static int glslang_compileGLSLToSPIRV(const glslang_CompileRequest_1_1& request) { for (const auto& diag : optDiags) { - // TODO(JS): - // Hack to stop CapabilityRayTracingMotionBlurNV outputting an error - if (diag.level == SPV_MSG_ERROR && diag.message == "Invalid capability operand: 5341") - { - continue; - } - // Count the number of errors optErrorCount += int(diag.level <= SPV_MSG_ERROR); diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 465a7633f..2e1ab33f2 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -4516,6 +4516,8 @@ void TraceRay( // NOTE! // The name of the following functions may change when DXR supports // a feature similar to the `GL_NV_ray_tracing_motion_blur` extension +// +// https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_ray_tracing_motion_blur.txt void TraceMotionRay<payload_t>( RaytracingAccelerationStructure AccelerationStructure, |
