]> git.tdb.fi Git - libs/gl.git/blobdiff - builtin_data/_builtin.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / builtin_data / _builtin.glsl
index b7737356397ac92e13e08bcc722b6b3d0df268c7..dcbb6d0abc7753c07cfc5cafbce39ce27b59e013 100644 (file)
@@ -18,6 +18,10 @@ typedef vector(2) int ivec2;
 typedef vector(3) int ivec3;
 typedef vector(4) int ivec4;
 
+typedef vector(2) uint uvec2;
+typedef vector(3) uint uvec3;
+typedef vector(4) uint uvec4;
+
 typedef vector(2) bool bvec2;
 typedef vector(3) bool bvec3;
 typedef vector(4) bool bvec4;
@@ -35,6 +39,19 @@ typedef image(dimensions=1[], shadow, sampled) float sampler1DArrayShadow;
 typedef image(dimensions=2[], shadow, sampled) float sampler2DArrayShadow;
 typedef image(dimensions=cube, shadow, sampled) float samplerCubeShadow;
 typedef image(dimensions=cube[], shadow, sampled) float samplerCubeArrayShadow;
+typedef image(dimensions=2, sampled, multisample) float sampler2DMS;
+typedef image(dimensions=2[], sampled, multisample) float sampler2DMSArray;
+typedef image(dimensions=1) float image1D;
+typedef image(dimensions=2) float image2D;
+typedef image(dimensions=3) float image3D;
+typedef image(dimensions=cube) float imageCube;
+typedef image(dimensions=1[]) float image1DArray;
+typedef image(dimensions=2[]) float image2DArray;
+typedef image(dimensions=cube[]) float imageCubeArray;
+typedef image(dimensions=2, multisample) float image2DMS;
+typedef image(dimensions=2[], multisample) float image2DMSArray;
+
+const float PI = 3.1415926535;
 
 // BEGIN BUILTIN FUNCTIONS
 float radians(float degrees);
@@ -169,13 +186,9 @@ float mod(float x, float y);
 vec2 mod(vec2 x, vec2 y);
 vec3 mod(vec3 x, vec3 y);
 vec4 mod(vec4 x, vec4 y);
-vec2 mod(vec2 x, float y);
-vec3 mod(vec3 x, float y);
-vec4 mod(vec4 x, float y);
-float modf(float x, out float y);
-vec2 modf(vec2 x, out vec2 y);
-vec3 modf(vec3 x, out vec3 y);
-vec4 modf(vec4 x, out vec4 y);
+vec2 mod(vec2 x, float y) { return mod(x, vec2(y)); }
+vec3 mod(vec3 x, float y) { return mod(x, vec3(y)); }
+vec4 mod(vec4 x, float y) { return mod(x, vec4(y)); }
 float min(float x, float y);
 vec2 min(vec2 x, vec2 y);
 vec3 min(vec3 x, vec3 y);
@@ -184,12 +197,19 @@ int min(int x, int y);
 ivec2 min(ivec2 x, ivec2 y);
 ivec3 min(ivec3 x, ivec3 y);
 ivec4 min(ivec4 x, ivec4 y);
-vec2 min(vec2 x, float y);
-vec3 min(vec3 x, float y);
-vec4 min(vec4 x, float y);
-ivec2 min(ivec2 x, int y);
-ivec3 min(ivec3 x, int y);
-ivec4 min(ivec4 x, int y);
+uint min(uint x, uint y);
+uvec2 min(uvec2 x, uvec2 y);
+uvec3 min(uvec3 x, uvec3 y);
+uvec4 min(uvec4 x, uvec4 y);
+vec2 min(vec2 x, float y) { return min(x, vec2(y)); }
+vec3 min(vec3 x, float y) { return min(x, vec3(y)); }
+vec4 min(vec4 x, float y) { return min(x, vec4(y)); }
+ivec2 min(ivec2 x, int y) { return min(x, ivec2(y)); }
+ivec3 min(ivec3 x, int y) { return min(x, ivec3(y)); }
+ivec4 min(ivec4 x, int y) { return min(x, ivec4(y)); }
+uvec2 min(uvec2 x, uint y) { return min(x, uvec2(y)); }
+uvec3 min(uvec3 x, uint y) { return min(x, uvec3(y)); }
+uvec4 min(uvec4 x, uint y) { return min(x, uvec4(y)); }
 float max(float x, float y);
 vec2 max(vec2 x, vec2 y);
 vec3 max(vec3 x, vec3 y);
@@ -198,12 +218,19 @@ int max(int x, int y);
 ivec2 max(ivec2 x, ivec2 y);
 ivec3 max(ivec3 x, ivec3 y);
 ivec4 max(ivec4 x, ivec4 y);
-vec2 max(vec2 x, float y);
-vec3 max(vec3 x, float y);
-vec4 max(vec4 x, float y);
-ivec2 max(ivec2 x, int y);
-ivec3 max(ivec3 x, int y);
-ivec4 max(ivec4 x, int y);
+uint max(uint x, uint y);
+uvec2 max(uvec2 x, uvec2 y);
+uvec3 max(uvec3 x, uvec3 y);
+uvec4 max(uvec4 x, uvec4 y);
+vec2 max(vec2 x, float y) { return max(x, vec2(y)); }
+vec3 max(vec3 x, float y) { return max(x, vec3(y)); }
+vec4 max(vec4 x, float y) { return max(x, vec4(y)); }
+ivec2 max(ivec2 x, int y) { return max(x, ivec2(y)); }
+ivec3 max(ivec3 x, int y) { return max(x, ivec3(y)); }
+ivec4 max(ivec4 x, int y) { return max(x, ivec4(y)); }
+uvec2 max(uvec2 x, uint y) { return max(x, uvec2(y)); }
+uvec3 max(uvec3 x, uint y) { return max(x, uvec3(y)); }
+uvec4 max(uvec4 x, uint y) { return max(x, uvec4(y)); }
 float clamp(float x, float minVal, float maxVal);
 vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
 vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
@@ -212,19 +239,27 @@ int clamp(int x, int minVal, int maxVal);
 ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal);
 ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal);
 ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal);
-vec2 clamp(vec2 x, float minVal, float maxVal);
-vec3 clamp(vec3 x, float minVal, float maxVal);
-vec4 clamp(vec4 x, float minVal, float maxVal);
-ivec2 clamp(ivec2 x, int minVal, int maxVal);
-ivec3 clamp(ivec3 x, int minVal, int maxVal);
-ivec4 clamp(ivec4 x, int minVal, int maxVal);
+uint clamp(uint x, uint minVal, uint maxVal);
+uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal);
+uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal);
+uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal);
+vec2 clamp(vec2 x, float minVal, float maxVal) { return clamp(x, vec2(minVal), vec2(maxVal)); }
+vec3 clamp(vec3 x, float minVal, float maxVal) { return clamp(x, vec3(minVal), vec3(maxVal)); }
+vec4 clamp(vec4 x, float minVal, float maxVal) { return clamp(x, vec4(minVal), vec4(maxVal)); }
+ivec2 clamp(ivec2 x, int minVal, int maxVal) { return clamp(x, ivec2(minVal), ivec2(maxVal)); }
+ivec3 clamp(ivec3 x, int minVal, int maxVal) { return clamp(x, ivec3(minVal), ivec3(maxVal)); }
+ivec4 clamp(ivec4 x, int minVal, int maxVal) { return clamp(x, ivec4(minVal), ivec4(maxVal)); }
+uvec2 clamp(uvec2 x, uint minVal, uint maxVal) { return clamp(x, uvec2(minVal), uvec2(maxVal)); }
+uvec3 clamp(uvec3 x, uint minVal, uint maxVal) { return clamp(x, uvec3(minVal), uvec3(maxVal)); }
+uvec4 clamp(uvec4 x, uint minVal, uint maxVal) { return clamp(x, uvec4(minVal), uvec4(maxVal)); }
 float mix(float x, float y, float a);
 vec2 mix(vec2 x, vec2 y, vec2 a);
 vec3 mix(vec3 x, vec3 y, vec3 a);
 vec4 mix(vec4 x, vec4 y, vec4 a);
-vec2 mix(vec2 x, vec2 y, float a);
-vec3 mix(vec3 x, vec3 y, float a);
-vec4 mix(vec4 x, vec4 y, float a);
+float mix(float x, float y, float a) { return mix(x, y, float(a)); }
+vec2 mix(vec2 x, vec2 y, float a) { return mix(x, y, vec2(a)); }
+vec3 mix(vec3 x, vec3 y, float a) { return mix(x, y, vec3(a)); }
+vec4 mix(vec4 x, vec4 y, float a) { return mix(x, y, vec4(a)); }
 float mix(float x, float y, bool a);
 vec2 mix(vec2 x, vec2 y, bvec2 a);
 vec3 mix(vec3 x, vec3 y, bvec3 a);
@@ -233,20 +268,24 @@ int mix(int x, int y, bool a);
 ivec2 mix(ivec2 x, ivec2 y, bvec2 a);
 ivec3 mix(ivec3 x, ivec3 y, bvec3 a);
 ivec4 mix(ivec4 x, ivec4 y, bvec4 a);
+uint mix(uint x, uint y, bool a);
+uvec2 mix(uvec2 x, uvec2 y, bvec2 a);
+uvec3 mix(uvec3 x, uvec3 y, bvec3 a);
+uvec4 mix(uvec4 x, uvec4 y, bvec4 a);
 float step(float edge, float x);
 vec2 step(vec2 edge, vec2 x);
 vec3 step(vec3 edge, vec3 x);
 vec4 step(vec4 edge, vec4 x);
-vec2 step(float edge, vec2 x);
-vec3 step(float edge, vec3 x);
-vec4 step(float edge, vec4 x);
+vec2 step(float edge, vec2 x) { return step(vec2(edge), x); }
+vec3 step(float edge, vec3 x) { return step(vec3(edge), x); }
+vec4 step(float edge, vec4 x) { return step(vec4(edge), x); }
 float smoothstep(float edge0, float edge1, float x);
 vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
 vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
 vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
-vec2 smoothstep(float edge0, float edge1, vec2 x);
-vec3 smoothstep(float edge0, float edge1, vec3 x);
-vec4 smoothstep(float edge0, float edge1, vec4 x);
+vec2 smoothstep(float edge0, float edge1, vec2 x) { return smoothstep(vec2(edge0), vec2(edge1), x); }
+vec3 smoothstep(float edge0, float edge1, vec3 x) { return smoothstep(vec3(edge0), vec3(edge1), x); }
+vec4 smoothstep(float edge0, float edge1, vec4 x) { return smoothstep(vec4(edge0), vec4(edge1), x); }
 bool isnan(float x);
 bvec2 isnan(vec2 x);
 bvec3 isnan(vec3 x);
@@ -255,26 +294,10 @@ bool isinf(float x);
 bvec2 isinf(vec2 x);
 bvec3 isinf(vec3 x);
 bvec4 isinf(vec4 x);
-int floatBitsToInt(float value);
-ivec2 floatBitsToInt(vec2 value);
-ivec3 floatBitsToInt(vec3 value);
-ivec4 floatBitsToInt(vec4 value);
-float intBitsToFloat(int value);
-vec2 intBitsToFloat(ivec2 value);
-vec3 intBitsToFloat(ivec3 value);
-vec4 intBitsToFloat(ivec4 value);
 float fma(float a, float b, float c);
 vec2 fma(vec2 a, vec2 b, vec2 c);
 vec3 fma(vec3 a, vec3 b, vec3 c);
 vec4 fma(vec4 a, vec4 b, vec4 c);
-float frexp(float x, out int exp);
-vec2 frexp(vec2 x, out ivec2 exp);
-vec3 frexp(vec3 x, out ivec3 exp);
-vec4 frexp(vec4 x, out ivec4 exp);
-float ldexp(float x, int exp);
-vec2 ldexp(vec2 x, ivec2 exp);
-vec3 ldexp(vec3 x, ivec3 exp);
-vec4 ldexp(vec4 x, ivec4 exp);
 float length(float x);
 float length(vec2 x);
 float length(vec3 x);
@@ -287,7 +310,7 @@ float dot(float x, float y);
 float dot(vec2 x, vec2 y);
 float dot(vec3 x, vec3 y);
 float dot(vec4 x, vec4 y);
-vec3 cross(vec3 x);
+vec3 cross(vec3 x, vec3 y);
 float normalize(float x);
 vec2 normalize(vec2 x);
 vec3 normalize(vec3 x);
@@ -296,14 +319,14 @@ float faceforward(float N, float I, float Nref);
 vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
 vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
 vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
-float reflect(float N, float I);
-vec2 reflect(vec2 N, vec2 I);
-vec3 reflect(vec3 N, vec3 I);
-vec4 reflect(vec4 N, vec4 I);
-float refract(float N, float I, float eta);
-vec2 refract(vec2 N, vec2 I, float eta);
-vec3 refract(vec3 N, vec3 I, float eta);
-vec4 refract(vec4 N, vec4 I, float eta);
+float reflect(float I, float N);
+vec2 reflect(vec2 I, vec2 N);
+vec3 reflect(vec3 I, vec3 N);
+vec4 reflect(vec4 I, vec4 N);
+float refract(float I, float N, float eta);
+vec2 refract(vec2 I, vec2 N, float eta);
+vec3 refract(vec3 I, vec3 N, float eta);
+vec4 refract(vec4 I, vec4 N, float eta);
 mat2 matrixCompMult(mat2 x, mat2 y);
 mat3 matrixCompMult(mat3 x, mat3 y);
 mat4 matrixCompMult(mat4 x, mat4 y);
@@ -343,36 +366,54 @@ bvec4 lessThan(vec4 x, vec4 y);
 bvec2 lessThan(ivec2 x, ivec2 y);
 bvec3 lessThan(ivec3 x, ivec3 y);
 bvec4 lessThan(ivec4 x, ivec4 y);
+bvec2 lessThan(uvec2 x, uvec2 y);
+bvec3 lessThan(uvec3 x, uvec3 y);
+bvec4 lessThan(uvec4 x, uvec4 y);
 bvec2 lessThanEqual(vec2 x, vec2 y);
 bvec3 lessThanEqual(vec3 x, vec3 y);
 bvec4 lessThanEqual(vec4 x, vec4 y);
 bvec2 lessThanEqual(ivec2 x, ivec2 y);
 bvec3 lessThanEqual(ivec3 x, ivec3 y);
 bvec4 lessThanEqual(ivec4 x, ivec4 y);
+bvec2 lessThanEqual(uvec2 x, uvec2 y);
+bvec3 lessThanEqual(uvec3 x, uvec3 y);
+bvec4 lessThanEqual(uvec4 x, uvec4 y);
 bvec2 greaterThan(vec2 x, vec2 y);
 bvec3 greaterThan(vec3 x, vec3 y);
 bvec4 greaterThan(vec4 x, vec4 y);
 bvec2 greaterThan(ivec2 x, ivec2 y);
 bvec3 greaterThan(ivec3 x, ivec3 y);
 bvec4 greaterThan(ivec4 x, ivec4 y);
+bvec2 greaterThan(uvec2 x, uvec2 y);
+bvec3 greaterThan(uvec3 x, uvec3 y);
+bvec4 greaterThan(uvec4 x, uvec4 y);
 bvec2 greaterThanEqual(vec2 x, vec2 y);
 bvec3 greaterThanEqual(vec3 x, vec3 y);
 bvec4 greaterThanEqual(vec4 x, vec4 y);
 bvec2 greaterThanEqual(ivec2 x, ivec2 y);
 bvec3 greaterThanEqual(ivec3 x, ivec3 y);
 bvec4 greaterThanEqual(ivec4 x, ivec4 y);
+bvec2 greaterThanEqual(uvec2 x, uvec2 y);
+bvec3 greaterThanEqual(uvec3 x, uvec3 y);
+bvec4 greaterThanEqual(uvec4 x, uvec4 y);
 bvec2 equal(vec2 x, vec2 y);
 bvec3 equal(vec3 x, vec3 y);
 bvec4 equal(vec4 x, vec4 y);
 bvec2 equal(ivec2 x, ivec2 y);
 bvec3 equal(ivec3 x, ivec3 y);
 bvec4 equal(ivec4 x, ivec4 y);
+bvec2 equal(uvec2 x, uvec2 y);
+bvec3 equal(uvec3 x, uvec3 y);
+bvec4 equal(uvec4 x, uvec4 y);
 bvec2 notEqual(vec2 x, vec2 y);
 bvec3 notEqual(vec3 x, vec3 y);
 bvec4 notEqual(vec4 x, vec4 y);
 bvec2 notEqual(ivec2 x, ivec2 y);
 bvec3 notEqual(ivec3 x, ivec3 y);
 bvec4 notEqual(ivec4 x, ivec4 y);
+bvec2 notEqual(uvec2 x, uvec2 y);
+bvec3 notEqual(uvec3 x, uvec3 y);
+bvec4 notEqual(uvec4 x, uvec4 y);
 bool any(bvec2 x);
 bool any(bvec3 x);
 bool any(bvec4 x);
@@ -382,34 +423,54 @@ bool all(bvec4 x);
 bool not(bvec2 x);
 bool not(bvec3 x);
 bool not(bvec4 x);
-void imulExtended(int x, int y, out int msb, out int lsb);
-void imulExtended(ivec2 x, ivec2 y, out ivec2 msb, out ivec2 lsb);
-void imulExtended(ivec3 x, ivec3 y, out ivec3 msb, out ivec3 lsb);
-void imulExtended(ivec4 x, ivec4 y, out ivec4 msb, out ivec4 lsb);
 int bitfieldExtract(int value, int offset, int bits);
 ivec2 bitfieldExtract(ivec2 value, int offset, int bits);
 ivec3 bitfieldExtract(ivec3 value, int offset, int bits);
 ivec4 bitfieldExtract(ivec4 value, int offset, int bits);
+uint bitfieldExtract(uint value, int offset, int bits);
+uvec2 bitfieldExtract(uvec2 value, int offset, int bits);
+uvec3 bitfieldExtract(uvec3 value, int offset, int bits);
+uvec4 bitfieldExtract(uvec4 value, int offset, int bits);
 int bitfieldInsert(int value, int insert, int offset, int bits);
 ivec2 bitfieldInsert(ivec2 value, ivec2 insert, int offset, int bits);
 ivec3 bitfieldInsert(ivec3 value, ivec3 insert, int offset, int bits);
 ivec4 bitfieldInsert(ivec4 value, ivec4 insert, int offset, int bits);
+uint bitfieldInsert(uint value, uint insert, int offset, int bits);
+uvec2 bitfieldInsert(uvec2 value, uvec2 insert, int offset, int bits);
+uvec3 bitfieldInsert(uvec3 value, uvec3 insert, int offset, int bits);
+uvec4 bitfieldInsert(uvec4 value, uvec4 insert, int offset, int bits);
 int bitfieldReverse(int value);
 ivec2 bitfieldReverse(ivec2 value);
 ivec3 bitfieldReverse(ivec3 value);
 ivec4 bitfieldReverse(ivec4 value);
+uint bitfieldReverse(uint value);
+uvec2 bitfieldReverse(uvec2 value);
+uvec3 bitfieldReverse(uvec3 value);
+uvec4 bitfieldReverse(uvec4 value);
 int bitCount(int value);
 ivec2 bitCount(ivec2 value);
 ivec3 bitCount(ivec3 value);
 ivec4 bitCount(ivec4 value);
+uint bitCount(uint value);
+uvec2 bitCount(uvec2 value);
+uvec3 bitCount(uvec3 value);
+uvec4 bitCount(uvec4 value);
 int findLSB(int value);
 ivec2 findLSB(ivec2 value);
 ivec3 findLSB(ivec3 value);
 ivec4 findLSB(ivec4 value);
+int findLSB(uint value);
+ivec2 findLSB(uvec2 value);
+ivec3 findLSB(uvec3 value);
+ivec4 findLSB(uvec4 value);
 int findMSB(int value);
 ivec2 findMSB(ivec2 value);
 ivec3 findMSB(ivec3 value);
 ivec4 findMSB(ivec4 value);
+int findMSB(uint value);
+ivec2 findMSB(uvec2 value);
+ivec3 findMSB(uvec3 value);
+ivec4 findMSB(uvec4 value);
 int textureSize(sampler1D sampler, int lod);
 ivec2 textureSize(sampler2D sampler, int lod);
 ivec3 textureSize(sampler3D sampler, int lod);
@@ -423,6 +484,36 @@ ivec2 textureSize(samplerCubeShadow sampler, int lod);
 ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
 ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
 ivec3 textureSize(samplerCubeArrayShadow sampler, int lod);
+ivec2 textureSize(sampler2DMS sampler, int lod);
+ivec3 textureSize(sampler2DMSArray sampler, int lod);
+vec2 textureQueryLod(sampler1D sampler, float P);
+vec2 textureQueryLod(sampler2D sampler, vec2 P);
+vec2 textureQueryLod(sampler3D sampler, vec3 P);
+vec2 textureQueryLod(sampler1DArray sampler, float P);
+vec2 textureQueryLod(sampler2DArray sampler, vec2 P);
+vec2 textureQueryLod(samplerCube sampler, vec3 P);
+vec2 textureQueryLod(samplerCubeArray sampler, vec3 P);
+vec2 textureQueryLod(sampler1DShadow sampler, float P);
+vec2 textureQueryLod(sampler2DShadow sampler, vec2 P);
+vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P);
+vec2 textureQueryLod(sampler1DArrayShadow sampler, float P);
+vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 P);
+vec2 textureQueryLod(samplerCubeArrayShadow sampler, vec3 P);
+int textureQueryLevels(sampler1D sampler);
+int textureQueryLevels(sampler2D sampler);
+int textureQueryLevels(sampler3D sampler);
+int textureQueryLevels(sampler1DArray sampler);
+int textureQueryLevels(sampler2DArray sampler);
+int textureQueryLevels(samplerCube sampler);
+int textureQueryLevels(samplerCubeArray sampler);
+int textureQueryLevels(sampler1DShadow sampler);
+int textureQueryLevels(sampler2DShadow sampler);
+int textureQueryLevels(samplerCubeShadow sampler);
+int textureQueryLevels(sampler1DArrayShadow sampler);
+int textureQueryLevels(sampler2DArrayShadow sampler);
+int textureQueryLevels(samplerCubeArrayShadow sampler);
+int textureSamples(sampler2DMS sampler);
+int textureSamples(sampler2DMSArray sampler);
 vec4 texture(sampler1D sampler, float P);
 vec4 texture(sampler2D sampler, vec2 P);
 vec4 texture(sampler3D sampler, vec3 P);
@@ -436,24 +527,96 @@ float texture(samplerCubeShadow sampler, vec4 P);
 float texture(sampler1DArrayShadow sampler, vec3 P);
 float texture(sampler2DArrayShadow sampler, vec4 P);
 float texture(samplerCubeArrayShadow sampler, vec4 P, float compare);
-vec4 textureLod(sampler1D sampler, float P);
-vec4 textureLod(sampler2D sampler, vec2 P);
-vec4 textureLod(sampler3D sampler, vec3 P);
-vec4 textureLod(sampler1DArray sampler, vec2 P);
-vec4 textureLod(sampler2DArray sampler, vec3 P);
-vec4 textureLod(samplerCube sampler, vec3 P);
-vec4 textureLod(samplerCubeArray sampler, vec4 P);
+vec4 textureLod(sampler1D sampler, float P, float lod);
+vec4 textureLod(sampler2D sampler, vec2 P, float lod);
+vec4 textureLod(sampler3D sampler, vec3 P, float lod);
+vec4 textureLod(sampler1DArray sampler, vec2 P, float lod);
+vec4 textureLod(sampler2DArray sampler, vec3 P, float lod);
+vec4 textureLod(samplerCube sampler, vec3 P, float lod);
+vec4 textureLod(samplerCubeArray sampler, vec4 P, float lod);
 vec4 texelFetch(sampler1D sampler, int P, int lod);
 vec4 texelFetch(sampler2D sampler, ivec2 P, int lod);
 vec4 texelFetch(sampler3D sampler, ivec3 P, int lod);
 vec4 texelFetch(sampler1DArray sampler, ivec2 P, int lod);
 vec4 texelFetch(sampler2DArray sampler, ivec3 P, int lod);
+vec4 texelFetch(sampler2DMS sampler, ivec2 P, int sample);
+vec4 texelFetch(sampler2DMSArray sampler, ivec3 P, int sample);
+int imageSize(image1D image);
+ivec2 imageSize(image2D image);
+ivec3 imageSize(image3D image);
+ivec2 imageSize(image1DArray image);
+ivec3 imageSize(image2DArray image);
+ivec2 imageSize(imageCube image);
+ivec3 imageSize(imageCubeArray image);
+ivec2 imageSize(image2DMS image);
+ivec3 imageSize(image2DMSArray image);
+int imageSamples(image2DMS image);
+int imageSamples(image2DMSArray image);
+vec4 imageLoad(image1D image, int P);
+vec4 imageLoad(image2D image, ivec2 P);
+vec4 imageLoad(image3D image, ivec3 P);
+vec4 imageLoad(image1DArray image, ivec2 P);
+vec4 imageLoad(image2DArray image, ivec3 P);
+vec4 imageLoad(imageCube image, ivec3 P);
+vec4 imageLoad(imageCubeArray image, ivec4 P);
+vec4 imageLoad(image2DMS image, ivec2 P, int sample);
+vec4 imageLoad(image2DMSArray image, ivec3 P, int sample);
+void imageStore(image1D image, int P, vec4 data);
+void imageStore(image2D image, ivec2 P, vec4 data);
+void imageStore(image3D image, ivec3 P, vec4 data);
+void imageStore(image1DArray image, ivec2 P, vec4 data);
+void imageStore(image2DArray image, ivec3 P, vec4 data);
+void imageStore(imageCube image, ivec3 P, vec4 data);
+void imageStore(imageCubeArray image, ivec4 P, vec4 data);
+void imageStore(image2DMS image, ivec2 P, int sample, vec4 data);
+void imageStore(image2DMSArray image, ivec3 P, int sample, vec4 data);
 // END BUILTIN FUNCTIONS
 
 #pragma MSP stage(vertex)
+in int gl_VertexID;
+in int gl_InstanceID;
 out gl_PerVertex
 {
   vec4 gl_Position;
+  float gl_PointSize;
+  float gl_ClipDistance[];
+};
+
+#pragma MSP stage(tess_control)
+in gl_PerVertex
+{
+  vec4 gl_Position;
+  float gl_PointSize;
+  float gl_ClipDistance[];
+} gl_in[];
+in int gl_PatchVerticesIn;
+in int gl_PrimitiveID;
+in int gl_InvocationID;
+out gl_PerVertex
+{
+  vec4 gl_Position;
+  float gl_PointSize;
+  float gl_ClipDistance[];
+} gl_out[];
+patch out float gl_TessLevelOuter[4];
+patch out float gl_TessLevelInner[2];
+
+#pragma MSP stage(tess_eval)
+in gl_PerVertex
+{
+  vec4 gl_Position;
+  float gl_PointSize;
+  float gl_ClipDistance[];
+} gl_in[];
+in int gl_PatchVerticesIn;
+in int gl_PrimitiveID;
+in vec3 gl_TessCoord;
+patch in float gl_TessLevelOuter[4];
+patch in float gl_TessLevelInner[2];
+out gl_PerVertex
+{
+  vec4 gl_Position;
+  float gl_PointSize;
   float gl_ClipDistance[];
 };
 
@@ -461,13 +624,19 @@ out gl_PerVertex
 in gl_PerVertex
 {
   vec4 gl_Position;
+  float gl_PointSize;
   float gl_ClipDistance[];
 } gl_in[];
+in int gl_PrimitiveIDIn;
+in int gl_InvocationID;
 out gl_PerVertex
 {
   vec4 gl_Position;
+  float gl_PointSize;
   float gl_ClipDistance[];
 };
+out int gl_PrimitiveID;
+out int gl_Layer;
 
 void EmitVertex();
 void EndPrimitive();
@@ -523,3 +692,20 @@ vec2 interpolateAtOffset(vec2 interpolant, vec2 offset);
 vec3 interpolateAtOffset(vec3 interpolant, vec2 offset);
 vec4 interpolateAtOffset(vec4 interpolant, vec2 offset);
 // END BUILTIN FRAGMENT FUNCTIONS
+
+in vec4 gl_FragCoord;
+in bool gl_FrontFacing;
+in float gl_ClipDistance[];
+in vec2 gl_PointCoord;
+in int gl_PrimitiveID;
+in int gl_SampleID;
+in vec2 gl_SamplePosition;
+in int gl_Layer;
+out float gl_FragDepth;
+
+#pragma MSP stage(compute)
+in uvec3 gl_NumWorkGroups;
+in uvec3 gl_WorkGroupID;
+in uvec3 gl_LocalInvocationID;
+in uvec3 gl_GlobalInvocationID;
+in uint gl_LocalInvocationIndex;