| <dawn>/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl:8:9 warning: 'textureSample' must only be called from uniform control flow | |
| v = textureSample(t, s, vec2(0, 0)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| <dawn>/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl:7:3 note: control flow depends on possibly non-uniform value | |
| while (x > v.x) @diagnostic(warning, derivative_uniformity) { | |
| ^^^^^ | |
| <dawn>/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl:8:9 note: return value of 'textureSample' may be non-uniform | |
| v = textureSample(t, s, vec2(0, 0)); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| #include <metal_stdlib> | |
| using namespace metal; | |
| struct tint_module_vars_struct { | |
| texture2d<float, access::sample> t; | |
| sampler s; | |
| }; | |
| struct main_inputs { | |
| float x [[user(locn0)]]; | |
| }; | |
| void main_inner(float x, tint_module_vars_struct tint_module_vars) { | |
| float4 v = float4(0.0f); | |
| { | |
| uint2 tint_loop_idx = uint2(4294967295u); | |
| while(true) { | |
| if (all((tint_loop_idx == uint2(0u)))) { | |
| break; | |
| } | |
| if ((x > v.x)) { | |
| } else { | |
| break; | |
| } | |
| v = tint_module_vars.t.sample(tint_module_vars.s, float2(0.0f)); | |
| { | |
| uint const tint_low_inc = (tint_loop_idx.x - 1u); | |
| tint_loop_idx.x = tint_low_inc; | |
| uint const tint_carry = uint((tint_low_inc == 4294967295u)); | |
| tint_loop_idx.y = (tint_loop_idx.y - tint_carry); | |
| } | |
| continue; | |
| } | |
| } | |
| } | |
| fragment void v_1(main_inputs inputs [[stage_in]], texture2d<float, access::sample> t [[texture(0)]], sampler s [[sampler(0)]]) { | |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.t=t, .s=s}; | |
| main_inner(inputs.x, tint_module_vars); | |
| } |