yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
6c292d3b
main
1#version 450 2#extension GL_ARB_sparse_texture_clamp : enable 3 4uniform sampler2D s2D ; 5uniform sampler3D s3D ; 6uniform sampler2DShadow s2DShadow ; 7uniform samplerCubeShadow sCubeShadow ; 8uniform sampler2DArrayShadow s2DArrayShadow ; 9uniform sampler2DRectShadow s2DRectShadow ; 10uniform samplerCubeArrayShadow sCubeArrayShadow ; 11 12uniform isamplerCube isCube ; 13uniform isampler2DArray is2DArray ; 14 15uniform usamplerCubeArray usCubeArray ; 16uniform usampler2DRect us2DRect ; 17 18in vec2 c2 ; 19in vec3 c3 ; 20in vec4 c4 ; 21 22in float lodClamp ; 23 24out vec4 outColor ; 25 26void main () 27{ 28int resident = 0 ; 29vec4 texel = vec4 (0.0 ); 30ivec4 itexel = ivec4 (0 ); 31uvec4 utexel = uvec4 (0 ); 32 33resident |=sparseTextureClampARB (s2D ,c2 ,lodClamp ,texel ); 34resident |=sparseTextureClampARB (s3D ,c3 ,lodClamp ,texel ,2.0 ); 35resident |=sparseTextureClampARB (isCube ,c3 ,lodClamp ,itexel ); 36resident |=sparseTextureClampARB (s2DShadow ,c3 ,lodClamp ,texel .x ); 37resident |=sparseTextureClampARB (sCubeArrayShadow ,c4 ,1.0 ,lodClamp ,texel .x ); 38 39texel += textureClampARB (s2D ,c2 ,lodClamp ); 40texel += textureClampARB (s3D ,c3 ,lodClamp ,2.0 ); 41itexel += textureClampARB (isCube ,c3 ,lodClamp ); 42texel .x += textureClampARB (s2DShadow ,c3 ,lodClamp ); 43texel .x += textureClampARB (sCubeArrayShadow ,c4 ,1.0 ,lodClamp ); 44 45resident |=sparseTextureOffsetClampARB (s3D ,c3 ,ivec3 (2 ),lodClamp ,texel ,2.0 ); 46resident |=sparseTextureOffsetClampARB (us2DRect ,c2 ,ivec2 (3 ),lodClamp ,utexel ); 47resident |=sparseTextureOffsetClampARB (s2DArrayShadow ,c4 ,ivec2 (5 ),lodClamp ,texel .z ); 48 49texel += textureOffsetClampARB (s3D ,c3 ,ivec3 (2 ),lodClamp ,2.0 ); 50utexel += textureOffsetClampARB (us2DRect ,c2 ,ivec2 (3 ),lodClamp ); 51texel .z += textureOffsetClampARB (s2DArrayShadow ,c4 ,ivec2 (5 ),lodClamp ); 52 53resident |=sparseTextureGradClampARB (s3D ,c3 ,c3 ,c3 ,lodClamp ,texel ); 54resident |=sparseTextureGradClampARB (sCubeShadow ,c4 ,c3 ,c3 ,lodClamp ,texel .y ); 55resident |=sparseTextureGradClampARB (usCubeArray ,c4 ,c3 ,c3 ,lodClamp ,utexel ); 56 57texel += textureGradClampARB (s3D ,c3 ,c3 ,c3 ,lodClamp ); 58texel .y += textureGradClampARB (sCubeShadow ,c4 ,c3 ,c3 ,lodClamp ); 59utexel += textureGradClampARB (usCubeArray ,c4 ,c3 ,c3 ,lodClamp ); 60 61resident |=sparseTextureGradOffsetClampARB (s2D ,c2 ,c2 ,c2 ,ivec2 (5 ),lodClamp ,texel ); 62resident |=sparseTextureGradOffsetClampARB (s2DRectShadow ,c3 ,c2 ,c2 ,ivec2 (6 ),lodClamp ,texel .w ); 63resident |=sparseTextureGradOffsetClampARB (is2DArray ,c3 ,c2 ,c2 ,ivec2 (2 ),lodClamp ,itexel ); 64 65texel += textureGradOffsetClampARB (s2D ,c2 ,c2 ,c2 ,ivec2 (5 ),lodClamp ); 66texel .w += textureGradOffsetClampARB (s2DRectShadow ,c3 ,c2 ,c2 ,ivec2 (6 ),lodClamp ); 67itexel += textureGradOffsetClampARB (is2DArray ,c3 ,c2 ,c2 ,ivec2 (2 ),lodClamp ); 68 69outColor = sparseTexelsResidentARB (resident ) ?texel :vec4 (itexel )+ vec4 (utexel ); 70}