shader-slang / slang

Making it easier to work with shaders
MIT License
2.07k stars 179 forks source link

reverse while loop will could cause issue when loop inversion is turned off #4153

Closed kaizhangNV closed 4 months ago

kaizhangNV commented 4 months ago

This is probably not a real issue. But when we turn the loop inversion off, this test will crash on Vulkan: tests/autodiff/reverse-while-loop-2.slang

technically, turning off loop inversion should not crash anything. But maybe because our loop reversion is assuming the loop inversion in default, so the unexpected behavior is expected.

Open this issue to remind us that we should fix the https://github.com/shader-slang/slang/issues/4151 as soon as possible.

saipraveenb25 commented 4 months ago

Looks like a direct SPIRV emit issue. The error goes away if we use -emit-spirv-via-glsl.