blob: b2e7ce2cd953b0ac01981477df07f9c403926561 [file] [log] [blame]
<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;
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
volatile bool VOLATILE_NAME = true; \
if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
};
void tint_symbol_inner(float x, texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
float4 v = float4(0.0f);
TINT_ISOLATE_UB(tint_volatile_true) while((x > v[0])) {
v = tint_symbol_3.sample(tint_symbol_4, float2(0.0f));
}
}
fragment void tint_symbol(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
tint_symbol_inner(tint_symbol_1.x, tint_symbol_5, tint_symbol_6);
return;
}