blob: d6189131d27233b50cd8ac982e3ffb6fffb97e4e [file] [log] [blame]
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:5:11 warning: 'dpdx' must only be called from uniform control flow
_ = dpdx(1.0);
^^^^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:3:3 note: control flow depends on possibly non-uniform value
switch (i32(x)) @diagnostic(warning, derivative_uniformity) {
^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:3:15 note: user-defined input 'x' of 'main' may be non-uniform
switch (i32(x)) @diagnostic(warning, derivative_uniformity) {
^
#include <metal_stdlib>
using namespace metal;
struct tint_symbol_inputs {
float x [[user(locn0)]];
};
int tint_f32_to_i32(float value) {
return select(2147483647, select((-2147483647 - 1), int(value), (value >= -2147483648.0f)), (value <= 2147483520.0f));
}
void tint_symbol_inner(float x) {
switch(tint_f32_to_i32(x)) {
default:
{
dfdx(1.0f);
break;
}
}
}
fragment void tint_symbol(tint_symbol_inputs inputs [[stage_in]]) {
tint_symbol_inner(inputs.x);
}