SPIRV-Cross/shaders-no-opt/frag/texture1d-emulation.legacy.frag
Hans-Kristian Arntzen 1c88730e12 GLSL: Implement 1D texture emulation for ES.
ES does not support 1D images at all. Fake it by promoting 1D images to
2D.
2022-05-27 11:51:34 +02:00

18 lines
416 B
GLSL

#version 450
layout(set = 0, binding = 0) uniform sampler1D uSamp;
layout(set = 0, binding = 1) uniform sampler1DShadow uSampShadow;
layout(location = 0) in vec4 vUV;
layout(location = 0) out vec4 FragColor;
void main()
{
// 1D
FragColor = texture(uSamp, vUV.x);
FragColor += textureProj(uSamp, vUV.xy);
// 1D Shadow
FragColor += texture(uSampShadow, vUV.xyz);
FragColor += textureProj(uSampShadow, vUV);
}