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
#[spirv(compute(threads(8,8)))]pubfnmain(#[spirv(descriptor_set = 0, binding = 0)]out:TexRgba32f){letmut value = vec3(0.1,0.2,0.3);letmut i = 0;loop{if i >= 32{break;}
i += 1;}unsafe{
out.write(uvec2(0,0), value.extend(1.0));}}
... will work, but adding a seemingly no-op value = value into that loop:
loop{
value = value;if i >= 32{break;}
i += 1;}
... will panic the compiler, saying:
error: malformed SPIR-V (in OpCompositeExtract: undefined ID %4547)
fwiw, an assignment after (or before) the loop triggers this error as well:
#[spirv(compute(threads(8,8)))]pubfnmain(#[spirv(descriptor_set = 0, binding = 0)]out:TexRgba32f){letmut val = vec3(0.1,0.2,0.3);letmut i = 0;while i < 10{
i += 1;}
val = val;unsafe{
out.write(uvec2(0,0), val.extend(1.0));}}
@Patryk27 I think there's something up with while loops and loops with loop { if ... { break; } } because I have a number of shaders that work with for i in range that won't work with any other looping mechanism.
Hi,
Compiling this code:
... will work, but adding a seemingly no-op
value = value
into that loop:... will panic the compiler, saying:
Meta:
The text was updated successfully, but these errors were encountered: