When targeting SpirV, Slang will misscompile global variables bound to a semantic when they are used in the same expression as WorkgroupSize(). #5027
Labels
goal:client support
Feature or fix needed for a current slang user.
kind:bug
something doesn't work like it should
Milestone
Hi !
Slang misscompiles this code:
When compiled with
slangc -target spirv test.slang -o test.spv
then dumped into glsl usingspirv-cross test.spv
, I get this:Here
gid
isn't initialized, which leads to problems (first detected as a device lost due to an incorrect index computation leading to an out of bound access).Weirdly this doesn't happen if I use
gid
directly without mixing it withWorkgroupSize()
or if I takeSV_GroupID
as main argument.It isn't specific to
SV_GroupID
, other semantics are also affected. It appears to be specific toWorkgroupSize()
though.This is a regression, it didn't happen before v2024.1.24. A quick bisection seems to point to commit 0b51902
The text was updated successfully, but these errors were encountered: