| <dawn>/test/tint/diagnostic_filtering/if_body_attribute.wgsl:7:9 warning: 'textureSample' must only be called from uniform control flow |
| _ = textureSample(t, s, vec2(0, 0)); |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| <dawn>/test/tint/diagnostic_filtering/if_body_attribute.wgsl:6:3 note: control flow depends on possibly non-uniform value |
| if (x > 0) @diagnostic(warning, derivative_uniformity) { |
| ^^ |
| |
| <dawn>/test/tint/diagnostic_filtering/if_body_attribute.wgsl:6:7 note: user-defined input 'x' of 'main' may be non-uniform |
| if (x > 0) @diagnostic(warning, derivative_uniformity) { |
| ^ |
| |
| #include <metal_stdlib> |
| using namespace metal; |
| struct tint_module_vars_struct { |
| texture2d<float, access::sample> t; |
| sampler s; |
| }; |
| struct tint_symbol_inputs { |
| float x [[user(locn0)]]; |
| }; |
| |
| void tint_symbol_inner(float x, tint_module_vars_struct tint_module_vars) { |
| if ((x > 0.0f)) { |
| tint_module_vars.t.sample(tint_module_vars.s, float2(0.0f)); |
| } |
| } |
| 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); |
| } |