SPIRV-Cross/reference/shaders/frag/helper-invocation.frag
Hans-Kristian Arntzen 61f1d8b2cf Support gl_HelperInvocation on GLSL and MSL.
There is no obvious builtin for this on HLSL.
2018-11-28 15:18:43 +01:00

29 lines
424 B
GLSL

#version 310 es
precision mediump float;
precision highp int;
layout(binding = 0) uniform mediump sampler2D uSampler;
layout(location = 0) in vec2 vUV;
layout(location = 0) out vec4 FragColor;
vec4 foo()
{
vec4 color;
if (!gl_HelperInvocation)
{
color = textureLod(uSampler, vUV, 0.0);
}
else
{
color = vec4(1.0);
}
return color;
}
void main()
{
FragColor = foo();
}