You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to compile the following any-hit shader in GLSL compatibility mode (e.g. slangc -allow-glsl -target spirv -entry main -O2 test.rahit -o test.spv), the terminateRayEXT and ignoreIntersectionEXT keywords are not recognized by slangc.
These two are conspicuously missing from glsl.meta.slang, probably because they're statement keywords and not functions.
Based on a quick look at the internals, the options are:
Add #define terminateRayEXT AcceptHitAndEndSearch() to glsl.meta.slang
Expand parseSyntaxDecl to allow a new keyword to map to a function call, then add syntax terminateRayEXT = AcceptHitAndEndSearch; to glsl.meta.slang
Add new AST nodes and parse in Parser::ParseStatement similar to discard
Considering terminateRayEXT and ignoreIntersectionEXT map directly to function calls (AcceptHitAndEndSearch() & IgnoreHit()) and this is just a compatibility feature, the third option seems a bit overkill. Option 1 is trivial to implement but would leak terminateRayEXT to all shader stages. To me, option 2 seems fairly clean and could be useful for other stuff as well.
I'm pretty confident I can fix this myself and submit a PR with any of the three options, but I'm not sure which one's the best from your POV.
When attempting to compile the following any-hit shader in GLSL compatibility mode (e.g.
slangc -allow-glsl -target spirv -entry main -O2 test.rahit -o test.spv
), the terminateRayEXT and ignoreIntersectionEXT keywords are not recognized by slangc.Output:
The text was updated successfully, but these errors were encountered: