Add ES 300 built-ins trunc, round, roundEven, modf, isnan, isinf, floatBitsToInt, floatBitsToUint, intBitsToFloat, uintBitsToFloat, packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16, and unpackHalf2x16, and new form of min, max, clamp, and mix.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21063 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
68
Test/300BuiltIns.frag
Normal file
68
Test/300BuiltIns.frag
Normal file
@@ -0,0 +1,68 @@
|
||||
#version 300 es
|
||||
|
||||
int imax, imin;
|
||||
uint umax, umin;
|
||||
|
||||
vec3 x, y;
|
||||
bvec3 bv;
|
||||
|
||||
uint uy;
|
||||
uvec2 uv2c;
|
||||
uvec2 uv2y;
|
||||
uvec2 uv2x;
|
||||
uvec4 uv4y;
|
||||
|
||||
ivec3 iv3a;
|
||||
ivec3 iv3b;
|
||||
|
||||
ivec4 iv4a;
|
||||
ivec4 iv4b;
|
||||
|
||||
float f;
|
||||
|
||||
vec2 v2a, v2b;
|
||||
vec4 v4;
|
||||
|
||||
void main()
|
||||
{
|
||||
// 1.3 int
|
||||
vec3 v = mix(x, y, bv);
|
||||
ivec4 iv10 = abs(iv4a);
|
||||
ivec4 iv11 = sign(iv4a);
|
||||
ivec4 iv12 = min(iv4a, iv4b);
|
||||
ivec4 iv13 = min(iv4a, imin);
|
||||
uvec2 u = min(uv2x, uv2y);
|
||||
uvec4 uv = min(uv4y, uy);
|
||||
ivec3 iv14 = max(iv3a, iv3b);
|
||||
ivec4 iv15 = max(iv4a, imax);
|
||||
uvec2 u10 = max(uv2x, uv2y);
|
||||
uvec2 u11 = max(uv2x, uy);
|
||||
ivec4 iv16 = clamp(iv4a, iv4a, iv4b);
|
||||
ivec4 iv17 = clamp(iv4a, imin, imax);
|
||||
uvec2 u12 = clamp(uv2x, uv2y, uv2c);
|
||||
uvec4 uv10 = clamp(uv4y, umin, umax);
|
||||
|
||||
// 1.3 float
|
||||
vec3 modfOut;
|
||||
vec3 v11 = modf(x, modfOut);
|
||||
|
||||
float t = trunc(f);
|
||||
vec2 v12 = round(v2a);
|
||||
vec2 v13 = roundEven(v2a);
|
||||
bvec2 b10 = isnan(v2a);
|
||||
bvec4 b11 = isinf(v4);
|
||||
|
||||
// 3.3 float
|
||||
int i = floatBitsToInt(f);
|
||||
uvec4 uv11 = floatBitsToUint(v4);
|
||||
vec4 v14 = intBitsToFloat(iv4a);
|
||||
vec2 v15 = uintBitsToFloat(uv2c);
|
||||
|
||||
// 4.0 pack
|
||||
uint u19 = packSnorm2x16(v2a);
|
||||
vec2 v20 = unpackSnorm2x16(uy);
|
||||
uint u15 = packUnorm2x16(v2a);
|
||||
vec2 v16 = unpackUnorm2x16(uy);
|
||||
uint u17 = packHalf2x16(v2b);
|
||||
vec2 v18 = unpackHalf2x16(uy);
|
||||
}
|
||||
@@ -30,6 +30,11 @@ void main()
|
||||
precision lowp int;
|
||||
int level1_low;
|
||||
sum += level1_low;
|
||||
|
||||
// test maxing precisions of args to get precision of builtin
|
||||
lowp float arg1;
|
||||
mediump float arg2;
|
||||
lowp float d = distance(arg1, arg2);
|
||||
|
||||
{
|
||||
int level2_low;
|
||||
|
||||
@@ -23,6 +23,7 @@ array100.frag
|
||||
comment.frag
|
||||
300.vert
|
||||
300.frag
|
||||
300BuiltIns.frag
|
||||
330.frag
|
||||
330comp.frag
|
||||
constErrors.frag
|
||||
|
||||
Reference in New Issue
Block a user