mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
16 lines
583 B
Text
16 lines
583 B
Text
|
#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);
|
||
|
}
|