| <dawn>/test/tint/diagnostic_filtering/case_body_attribute.wgsl:8:11 warning: 'textureSample' must only be called from uniform control flow |
| _ = textureSample(t, s, vec2(0, 0)); |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| <dawn>/test/tint/diagnostic_filtering/case_body_attribute.wgsl:6:3 note: control flow depends on possibly non-uniform value |
| switch (i32(x)) { |
| ^^^^^^ |
| |
| <dawn>/test/tint/diagnostic_filtering/case_body_attribute.wgsl:6:15 note: user-defined input 'x' of 'main' may be non-uniform |
| switch (i32(x)) { |
| ^ |
| |
| #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)]]; |
| }; |
| |
| 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, tint_module_vars_struct tint_module_vars) { |
| switch(tint_f32_to_i32(x)) { |
| case 0: |
| { |
| tint_module_vars.t.sample(tint_module_vars.s, float2(0.0f)); |
| break; |
| } |
| default: |
| { |
| break; |
| } |
| } |
| } |
| 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); |
| } |