bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt
2014-02-10 23:06:13 -08:00

23 lines
608 B
Text

#version 300 es
in mediump vec3 uv;
out lowp vec4 outColor;
uniform sampler2D tex;
uniform sampler3D vol;
void main()
{
lowp vec4 c;
// texture offset forms
c = textureOffset (tex, uv.xy, ivec2(-2,-3));
c += textureOffset (tex, uv.xy, ivec2(4,5), 0.5);
c += textureOffset (vol, uv.xyz, ivec3(-2,-3,-4));
c += textureOffset (vol, uv.xyz, ivec3(4,5,6), -0.5);
// texelFetch forms
c += texelFetch (tex, ivec2(1,2), 1);
c += texelFetch (vol, ivec3(1,2,3), 2);
c += texelFetchOffset (tex, ivec2(1,2), 3, ivec2(-2,-3));
c += texelFetchOffset (vol, ivec3(1,2,3), 0, ivec3(-2,-3,-4));
outColor = c;
}