-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unoptimized/Debug builds with dead code elimination disabled? #122
Comments
That's a surprisingly tricky topic because the removal can happen in different stages (starting at the initial GLSL to SPIRV compilation, but even as late as in the actual sokol application - for instance GL driver GLSL compilers are free to remove unused bindings as well). In the past there was also a situation where unused vertex attributes were dropped by the SPIRVTools optimizer passes, but that had been fixed in this commit: The optionally generated reflection-info functions (only in the C code generation so far) are also a (somewhat awkward) way to deal with the problem, but that's not a great solution for iterating and experimenting. Long story short, I haven't found a good solution for this. Unfortunately it's not as easy as disabling all optimizations. Unrelated to that I have thought about a command line option to disable the SPIRVTools optimizer passes completely (here: Lines 119 to 164 in 6362c8f
|
Currently the sokol-shdc compiler aggressively eliminates dead code, which is a bit annoying when iterating on shaders. That's because it also removes all of the uniform and texture slots from the generated headers.
I looked into the source but unfortunately couldn't find a way to disable it in the backend. Maybe there is a way to somehow still generate the binding slots correctly even if they compile out..?
The text was updated successfully, but these errors were encountered: