KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 815 forks source link

spirv-opt: loop-unroll causing spirv-val error with shader #3621

Closed danginsburg closed 2 weeks ago

danginsburg commented 2 weeks ago

With the SPIR-V shader attached to this bug, running spirv-opt with a loop unroll pass generated invalid spir-v:

> spirv-opt --version
SPIRV-Tools v2024.2 v2019.1-2077-g65d30c31

> spirv-opt --loop-unroll test.spv -o opt.spv

Produces a shader that fails spirv-val:

> spirv-val opt.spv
error: line 415: ID '23262[%23262]' has not been defined
  %25204 = OpULessThan %bool %23262 %uint_4

test.zip

greg-lunarg commented 2 weeks ago

Why was this filed against glslang instead of spirv-tools?

danginsburg commented 2 weeks ago

Hah, sorry, I had two tabs up because I had been looking at an old related issue and filed it on the wrong repo (issue: https://github.com/KhronosGroup/glslang/issues/2877)