https://github.com/shader-slang/slang
Revision cbedf01cc53b848dfcc086f04098ef438121a7c7 authored by Tim Foley on 19 April 2018, 19:22:20 UTC, committed by GitHub on 19 April 2018, 19:22:20 UTC
The cross-compilation logic for geometry shaders would look through the user's entry point for calls like `someStream.Emit<X>(val)` and turn that into `outputGlobals = val; EmitVertex();`.

It was recognizing the `Emit()` calls by looking at the callee in all `call` instructions and seeing if it was registered to lower to GLSL as `EmitVertex()`. The logic was try to look "through" `specialize` instructions (to deal with the `<X>` bit in the call above), but this wasn't updated for the new IR encoding where the first operand to a `specialize` is the generic being specialized, and not the function nested inside it.

The fix here is to properly look through both `specialize` instructions and generics. This is kind of a gross operation and we've done things like it in a few places, so it might be something we try to extract into a utility function in the future.
1 parent 163bf58
History
Tip revision: cbedf01cc53b848dfcc086f04098ef438121a7c7 authored by Tim Foley on 19 April 2018, 19:22:20 UTC
Fix GS cross-compilation after IR type system change (#507)
Tip revision: cbedf01
File Mode Size
allocator.h -rw-r--r-- 840 bytes
array-view.h -rw-r--r-- 2.1 KB
array.h -rw-r--r-- 2.5 KB
basic.h -rw-r--r-- 239 bytes
common.h -rw-r--r-- 1.9 KB
core.natvis -rw-r--r-- 1.8 KB
core.vcxproj -rw-r--r-- 9.5 KB
dictionary.h -rw-r--r-- 12.8 KB
exception.h -rw-r--r-- 2.1 KB
hash.h -rw-r--r-- 1.8 KB
int-set.h -rw-r--r-- 3.8 KB
list.h -rw-r--r-- 13.1 KB
platform.cpp -rw-r--r-- 1.2 KB
platform.h -rw-r--r-- 758 bytes
secure-crt.h -rw-r--r-- 1.9 KB
slang-com-ptr.h -rw-r--r-- 7.1 KB
slang-defines.h -rw-r--r-- 11.2 KB
slang-free-list.cpp -rw-r--r-- 4.2 KB
slang-free-list.h -rw-r--r-- 4.5 KB
slang-io.cpp -rw-r--r-- 3.7 KB
slang-io.h -rw-r--r-- 1.1 KB
slang-math.h -rw-r--r-- 4.3 KB
slang-result.h -rw-r--r-- 6.7 KB
slang-string-util.cpp -rw-r--r-- 689 bytes
slang-string-util.h -rw-r--r-- 304 bytes
slang-string.cpp -rw-r--r-- 8.2 KB
slang-string.h -rw-r--r-- 18.7 KB
smart-pointer.h -rw-r--r-- 4.1 KB
stream.cpp -rw-r--r-- 4.8 KB
stream.h -rw-r--r-- 1.8 KB
text-io.cpp -rw-r--r-- 7.0 KB
text-io.h -rw-r--r-- 7.5 KB
token-reader.cpp -rw-r--r-- 23.1 KB
token-reader.h -rw-r--r-- 7.1 KB
type-traits.h -rw-r--r-- 959 bytes

back to top