2 #extension GL_ARB_sparse_texture_clamp: enable
\r
4 uniform sampler2D s2D;
\r
5 uniform sampler3D s3D;
\r
6 uniform sampler2DShadow s2DShadow;
\r
7 uniform samplerCubeShadow sCubeShadow;
\r
8 uniform sampler2DArrayShadow s2DArrayShadow;
\r
9 uniform sampler2DRectShadow s2DRectShadow;
\r
10 uniform samplerCubeArrayShadow sCubeArrayShadow;
\r
12 uniform isamplerCube isCube;
\r
13 uniform isampler2DArray is2DArray;
\r
15 uniform usamplerCubeArray usCubeArray;
\r
16 uniform usampler2DRect us2DRect;
\r
29 vec4 texel = vec4(0.0);
\r
30 ivec4 itexel = ivec4(0);
\r
31 uvec4 utexel = uvec4(0);
\r
33 resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel);
\r
34 resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0);
\r
35 resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel);
\r
36 resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x);
\r
37 resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x);
\r
39 texel += textureClampARB(s2D, c2, lodClamp);
\r
40 texel += textureClampARB(s3D, c3, lodClamp, 2.0);
\r
41 itexel += textureClampARB(isCube, c3, lodClamp);
\r
42 texel.x += textureClampARB(s2DShadow, c3, lodClamp);
\r
43 texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp);
\r
45 resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0);
\r
46 resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel);
\r
47 resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z);
\r
49 texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0);
\r
50 utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp);
\r
51 texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp);
\r
53 resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel);
\r
54 resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y);
\r
55 resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel);
\r
57 texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp);
\r
58 texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp);
\r
59 utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp);
\r
61 resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel);
\r
62 resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w);
\r
63 resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel);
\r
65 texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp);
\r
66 texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp);
\r
67 itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp);
\r
69 outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel);
\r