summaryrefslogtreecommitdiffstats
path: root/source/slang/mangle.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2019-01-24 11:31:35 -0800
committerGitHub <noreply@github.com>2019-01-24 11:31:35 -0800
commiteda82cbfb92d45fbbff8dfd990798605d277608a (patch)
tree511d10d0584fe3e580e0235d8e6aaf133e7b2513 /source/slang/mangle.cpp
parent968d7b4084fd2e8561b7d5e65f359b05dc3d7c78 (diff)
Fix a regression in geometry shader cross-compilation (#794)
The underlying problem here was that legalization of entry point parameters for GLSL eliminates all the parameters to `main()`, but we still left a dangling reference to one of those parameters if it was a geometry shader output stream. The un-parented parameter would lead to an infinite loop in a later IR step, because it would never be reached by the transformation, and thus could never change its status to the one for "visited" instructions. The fix here is to simply replace any refernces to the GS input stream parameter with an `undefined` instruction in the IR, and then rely on the fact that the downstream GLSL emit logic wouldn't actually reference that value anyway (hence why the danlging reference wasn't originally an issue). I included a basic cross-compilation test case for geometry shaders to try to avoid subsequent regressions like this (Vulkan GS support is one of the most commonly recurring regressions we've had). The comment I put into the IR legalization logic makes it clear that the strategy used there isn't 100% rock-solid anyway (it only works in all the `EmitVertex()` calls come from the shader entry point function, and not subroutines. Adding a better (more robust) translation strategy for geometry shaders would be a nice bit of future work.
Diffstat (limited to 'source/slang/mangle.cpp')
0 files changed, 0 insertions, 0 deletions