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
This is not unique to us: as demonstrated there, do-while loops compiled by glslang produce the same Naga error as any SPIR-T loops lifted to SPIR-V - after all, both use the same SPIR-V feature that allows the backedge branch to be a OpBranchConditional between:
going back to the loop header (i.e. the backedge itself)
leaving to the loop merge block (i.e. breaking out of the loop)
This is a bug on their end, and the WGSL break if feature appears to have been designed to encode such "conditional backedges", but currently there's no detection for them to produce the appropriate naga AST.
We could work around it by doing what they do in their GLSL front-end: generate a "conditional break" inside the "loop body" (i.e. before the "loop continue" block declared by OpLoopMerge), and then always have unconditional backedges, but that's arguably worse-quality SPIR-V.
(not to mention that spirv-opt could convert to the "more idiomatic" form, undoing that compatibility effort)
The text was updated successfully, but these errors were encountered:
Context: gfx-rs/naga#1977 (comment)
This is not unique to us: as demonstrated there,
do
-while
loops compiled byglslang
produce the same Naga error as any SPIR-T loops lifted to SPIR-V - after all, both use the same SPIR-V feature that allows the backedge branch to be aOpBranchConditional
between:This is a bug on their end, and the WGSL
break if
feature appears to have been designed to encode such "conditional backedges", but currently there's no detection for them to produce the appropriate naga AST.We could work around it by doing what they do in their GLSL front-end: generate a "conditional
break
" inside the "loop body" (i.e. before the "loop continue" block declared byOpLoopMerge
), and then always have unconditional backedges, but that's arguably worse-quality SPIR-V.(not to mention that
spirv-opt
could convert to the "more idiomatic" form, undoing that compatibility effort)The text was updated successfully, but these errors were encountered: