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
hello

back to top