We may be using unoptimised shaders #1327
Replies: 2 comments 1 reply
-
I've pushed some work to address this here: AnyOldName3@e16430d Here's what I wrote in the commit message:
The patch itself is relatively small except for the recompiled shaders (which can easily be recompiled again), so it should be fine to shelve this until it turns out to be necessary. Hopefully if anyone's hitting an optimisation-related problem on a non-desktop platform, this will show up in a search and they can try it without too much hassle. |
Beta Was this translation helpful? Give feedback.
-
I've done a first pass review and the changes look good, could you generate a PR from the changes? |
Beta Was this translation helpful? Give feedback.
-
As a tangent to investigating something else, I realised that we're compiling shaders with
glslang::SpvOptions::disableOptimizer
set totrue
. That sounds bad, but at least historically, it doesn't seem to have been intended to optimise shaders properly anyway, and instead was just a badly-named variable controlling whether HLSL legalisation occurred when compiling a shader written in one language version to bytecode for a different shader model version.The expectation, at least in 2019, was that the generated SPIR-V would be run through SPIRV-Tools-opt. I haven't been able to find anything confirming that that's changed.
If it is indeed still necessary, then it should be a fairly minor change to make, as we've already got a dependency on SPIRV-Tools via glslang.
Beta Was this translation helpful? Give feedback.
All reactions