blob: 4868c1cd0b12f0ba35d1fb46afa0a7efdb664cb6 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
sampler Sampler;
texture2d<float, access::sample> randomTexture;
texture2d<float, access::sample> depthTexture;
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
{volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_symbol_outputs {
float4 tint_symbol_1 [[color(0)]];
};
struct tint_symbol_inputs {
float2 vUV [[user(locn0)]];
};
float4 tint_symbol_inner(float2 vUV, tint_module_vars_struct tint_module_vars) {
float3 const random = tint_module_vars.randomTexture.sample(tint_module_vars.Sampler, vUV).xyz;
int i = 0;
{
while(true) {
TINT_ISOLATE_UB(tint_volatile_false)
if ((i < 1)) {
} else {
break;
}
float3 const offset = float3(random[0u]);
bool v = false;
if ((offset[0u] < 0.0f)) {
v = true;
} else {
v = (offset[1u] < 0.0f);
}
bool v_1 = false;
if (v) {
v_1 = true;
} else {
v_1 = (offset[0u] > 1.0f);
}
bool v_2 = false;
if (v_1) {
v_2 = true;
} else {
v_2 = (offset[1u] > 1.0f);
}
if (v_2) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
{
}
continue;
}
float const sampleDepth = 0.0f;
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
{
}
continue;
}
}
return float4(1.0f);
}
fragment tint_symbol_outputs tint_symbol(tint_symbol_inputs inputs [[stage_in]], sampler Sampler [[sampler(0)]], texture2d<float, access::sample> randomTexture [[texture(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.Sampler=Sampler, .randomTexture=randomTexture};
tint_symbol_outputs tint_wrapper_result = {};
tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(inputs.vUV, tint_module_vars);
return tint_wrapper_result;
}