| <dawn>/test/tint/diagnostic_filtering/while_loop_attribute.wgsl:5:21 warning: 'dpdx' must only be called from uniform control flow | |
| while (x > 0.0 && dpdx(1.0) > 0.0) { | |
| ^^^^^^^^^ | |
| <dawn>/test/tint/diagnostic_filtering/while_loop_attribute.wgsl:5:3 note: control flow depends on possibly non-uniform value | |
| while (x > 0.0 && dpdx(1.0) > 0.0) { | |
| ^^^^^ | |
| <dawn>/test/tint/diagnostic_filtering/while_loop_attribute.wgsl:5:21 note: return value of 'dpdx' may be non-uniform | |
| while (x > 0.0 && dpdx(1.0) > 0.0) { | |
| ^^^^^^^^^ | |
| #include <metal_stdlib> | |
| using namespace metal; | |
| #define TINT_ISOLATE_UB(VOLATILE_NAME) \ | |
| volatile bool VOLATILE_NAME = true; \ | |
| if (VOLATILE_NAME) | |
| struct tint_symbol_inputs { | |
| float x [[user(locn0)]]; | |
| }; | |
| void tint_symbol_inner(float x) { | |
| float4 v = float4(0.0f); | |
| { | |
| TINT_ISOLATE_UB(tint_volatile_true) while(true) { | |
| bool v_1 = false; | |
| if ((x > 0.0f)) { | |
| v_1 = (dfdx(1.0f) > 0.0f); | |
| } else { | |
| v_1 = false; | |
| } | |
| if (v_1) { | |
| } else { | |
| break; | |
| } | |
| { | |
| } | |
| continue; | |
| } | |
| } | |
| } | |
| fragment void tint_symbol(tint_symbol_inputs inputs [[stage_in]]) { | |
| tint_symbol_inner(inputs.x); | |
| } |