| <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; | |
| }; | |
| #define TINT_ISOLATE_UB(VOLATILE_NAME) \ | |
| {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;} | |
| struct tint_symbol_inputs { | |
| float x [[user(locn0)]]; | |
| }; | |
| void tint_symbol_inner(float x, tint_module_vars_struct tint_module_vars) { | |
| float4 v = float4(0.0f); | |
| { | |
| while(true) { | |
| TINT_ISOLATE_UB(tint_volatile_false) | |
| if ((x > v[0u])) { | |
| } else { | |
| break; | |
| } | |
| v = tint_module_vars.t.sample(tint_module_vars.s, float2(0.0f)); | |
| { | |
| } | |
| continue; | |
| } | |
| } | |
| } | |
| fragment void tint_symbol(tint_symbol_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}; | |
| tint_symbol_inner(inputs.x, tint_module_vars); | |
| } |