Optimization workflow for SPIR-V. Why is spirv-opt only used if you go through GLSLang->SPIR-V? #9077
-
|
Hey, slang/source/slang-glslang/slang-glslang.cpp Line 253 in d90d869 rather than using optimizations that GLSLang could already can apply internally https://github.com/KhronosGroup/glslang/blob/f7c910864c67fc8a347184769b6c7bd6ae4c32ad/SPIRV/SpvTools.cpp#L184 Is there a reason why those optimization passes aren't be applied to SPIR-V output directly from Slang code, rather than going through GLSL/GLSLang? It would certainly be faster to compile than introducing a Slang->GLSL stage. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Those optimizations are being used in the direct-to-SPIR-V approach too. See: slang/source/slang/slang-emit.cpp Line 2782 in 768ae51 calling slang/source/slang/slang-emit.cpp Line 2621 in 768ae51 which runs the optimizations using the downstream compiler. It's just a bit confusing that the same |
Beta Was this translation helpful? Give feedback.
-
|
Ah ok, thanks for the reply. Yes, I didn't think the glslang portion of the tool would be hit in the Slang->SPIR-V workflow. |
Beta Was this translation helpful? Give feedback.
Those optimizations are being used in the direct-to-SPIR-V approach too. See:
slang/source/slang/slang-emit.cpp
Line 2782 in 768ae51
calling
slang/source/slang/slang-emit.cpp
Line 2621 in 768ae51
which runs the optimizations using the downstream compiler.
It's just a bit confusing that the same
slang-glslangdownstream compiler is used both for compiling GLSL->SPIR-V but also for optimizing SPIR-V->SPIR-V.