X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=builtin_data%2F_builtin.glsl;h=94a7ca696c4f9d5187f15a5cd8abbc9656b5c737;hb=bb386d895f5fce2f0099886fdf7e7073b18246e8;hp=3bf722cd441b13a627d58e8b8cb85b9841fd5ef8;hpb=34e3f9d66eb394d8ad69ee66db0cca35b0a15123;p=libs%2Fgl.git diff --git a/builtin_data/_builtin.glsl b/builtin_data/_builtin.glsl index 3bf722cd..94a7ca69 100644 --- a/builtin_data/_builtin.glsl +++ b/builtin_data/_builtin.glsl @@ -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; @@ -180,12 +184,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); +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); @@ -194,12 +205,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); +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); @@ -208,12 +226,19 @@ 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); +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); @@ -230,6 +255,10 @@ 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); @@ -324,36 +353,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); @@ -367,26 +414,50 @@ 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);