bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt

16 lines
583 B
Text
Raw Normal View History

2015-07-28 23:04:55 -04:00
#version 300 es
// There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler)
// was producing a missing cast between half4 and float4 on Metal output.
// Shader is a minimal part of Unity's camera motion blur shader that exposes the bug
vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod(s, coord.xy, coord.w); }
uniform highp sampler2D _CameraDepthTexture;
in highp vec2 varUV;
out mediump vec4 _fragData;
void main()
{
highp float z = xll_tex2Dlod(_CameraDepthTexture, vec4(varUV, 0.0, 0.0)).x;
_fragData = vec4(z);
}