2013-01-10 18:20:47 +00:00
|
|
|
#version 120
|
|
|
|
|
2013-01-31 22:55:53 +00:00
|
|
|
float lowp;
|
|
|
|
float mediump;
|
|
|
|
float highp;
|
2013-01-10 18:20:47 +00:00
|
|
|
|
2013-01-31 22:55:53 +00:00
|
|
|
float precision;
|
2013-01-10 18:20:47 +00:00
|
|
|
|
|
|
|
in vec4 i;
|
|
|
|
out vec4 o;
|
|
|
|
|
2013-03-01 21:53:13 +00:00
|
|
|
uniform sampler2D s2D;
|
|
|
|
centroid varying vec2 centTexCoord;
|
|
|
|
|
2013-02-12 08:02:20 +00:00
|
|
|
uniform mat4x2 m;
|
|
|
|
|
2013-02-28 20:49:41 +00:00
|
|
|
struct s {
|
|
|
|
float f;
|
|
|
|
};
|
|
|
|
|
2013-01-10 18:20:47 +00:00
|
|
|
void main()
|
|
|
|
{
|
2013-02-12 08:02:20 +00:00
|
|
|
mat2x3 m23 = mat2x3(m);
|
2013-02-28 20:49:41 +00:00
|
|
|
|
|
|
|
int a;
|
|
|
|
bool b;
|
|
|
|
s sv = s(a);
|
|
|
|
float[2] ia = float[2](3, i.y);
|
|
|
|
float f1 = 1;
|
|
|
|
float f = a;
|
|
|
|
f = a;
|
|
|
|
ivec3 iv3;
|
|
|
|
vec3 v3 = iv3;
|
|
|
|
f = f + a;
|
|
|
|
f = a - f;
|
|
|
|
f += a;
|
|
|
|
f = a - f;
|
|
|
|
v3 *= iv3;
|
2013-11-12 03:31:24 +00:00
|
|
|
v3 = iv3 / 2.0f;
|
2013-02-28 20:49:41 +00:00
|
|
|
v3 = 3.0 * iv3;
|
|
|
|
v3 = 2 * v3;
|
|
|
|
v3 = v3 - 2;
|
|
|
|
if (f < a ||
|
|
|
|
a <= f ||
|
|
|
|
f > a ||
|
|
|
|
f >= a ||
|
|
|
|
a == f ||
|
|
|
|
f != a);
|
|
|
|
f = b ? a : f;
|
|
|
|
f = b ? f : a;
|
|
|
|
f = b ? a : a;
|
|
|
|
s news = sv;
|
|
|
|
|
|
|
|
i.xy + i.xyz; // ERROR
|
|
|
|
m * i.xyz; // ERROR
|
|
|
|
m + i; // ERROR
|
|
|
|
int aoeu = 1.0; // ERROR
|
|
|
|
f = b; // ERROR
|
|
|
|
f = a + b; // ERROR
|
|
|
|
f = b * a; // ERROR
|
|
|
|
b = a; // ERROR
|
|
|
|
b = b + f; // ERROR
|
|
|
|
f |= b; // ERROR
|
2013-03-01 21:53:13 +00:00
|
|
|
|
|
|
|
gl_FragColor = texture2D(s2D, centTexCoord);
|
2013-04-25 16:44:03 +00:00
|
|
|
|
|
|
|
float flat;
|
|
|
|
float smooth;
|
|
|
|
float noperspective;
|
|
|
|
float uvec2;
|
|
|
|
float uvec3;
|
|
|
|
float uvec4;
|
|
|
|
//packed; // ERROR, reserved word
|
2013-05-28 07:29:58 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
mat4 m;
|
|
|
|
vec4 v;
|
|
|
|
bool b;
|
|
|
|
gl_FragColor += b ? v : m; // ERROR, types don't match around ":"
|
|
|
|
}
|
2013-06-25 21:53:59 +00:00
|
|
|
|
|
|
|
gl_FragColor.xr; // ERROR, swizzlers not from same field space
|
2013-08-27 03:59:04 +00:00
|
|
|
gl_FragColor.xyxyx.xy; // ERROR, cannot make a vec5, even temporarily
|
2013-06-25 21:53:59 +00:00
|
|
|
centTexCoord.z; // ERROR, swizzler out of range
|
|
|
|
(a,b) = true; // ERROR, not an l-value
|
2013-01-10 18:20:47 +00:00
|
|
|
}
|
2013-04-25 16:44:03 +00:00
|
|
|
|
|
|
|
float imageBuffer;
|
|
|
|
float uimage2DRect;
|
2013-06-25 21:53:59 +00:00
|
|
|
|
|
|
|
int main() {} // ERROR
|
|
|
|
void main(int a) {} // ERROR
|
|
|
|
|
|
|
|
const int a; // ERROR
|
|
|
|
|
|
|
|
int foo(in float a);
|
|
|
|
int foo(out float a) // ERROR
|
|
|
|
{
|
|
|
|
return 3.2; // ERROR
|
|
|
|
foo(a); // ERROR
|
|
|
|
}
|
2013-08-08 16:22:54 +00:00
|
|
|
|
|
|
|
bool gen(vec3 v)
|
|
|
|
{
|
2013-11-12 03:31:24 +00:00
|
|
|
if (abs(v[0]) < 1e-4F && abs(v[1]) < 1e-4)
|
2013-08-08 16:22:54 +00:00
|
|
|
return true;
|
2013-08-27 03:59:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void v1()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void v2()
|
|
|
|
{
|
|
|
|
return v1(); // ERROR, no expression allowed, even though void
|
|
|
|
}
|
2013-09-08 21:04:46 +00:00
|
|
|
|
|
|
|
void atest()
|
|
|
|
{
|
|
|
|
vec4 v = gl_TexCoord[1];
|
|
|
|
v += gl_TexCoord[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
varying vec4 gl_TexCoord[6]; // okay, assigning a size
|
|
|
|
varying vec4 gl_TexCoord[5]; // ERROR, changing size
|
2013-11-22 17:52:58 +00:00
|
|
|
|
|
|
|
mat2x2 m22;
|
|
|
|
mat2x3 m23;
|
|
|
|
mat2x4 m24;
|
|
|
|
|
|
|
|
mat3x2 m32;
|
|
|
|
mat3x3 m33;
|
|
|
|
mat3x4 m34;
|
|
|
|
|
|
|
|
mat4x2 m42;
|
|
|
|
mat4x3 m43;
|
|
|
|
mat4x4 m44;
|
|
|
|
|
|
|
|
void foo123()
|
|
|
|
{
|
|
|
|
mat2 r2 = matrixCompMult(m22, m22);
|
|
|
|
mat3 r3 = matrixCompMult(m33, m33);
|
|
|
|
mat4 r4 = matrixCompMult(m44, m44);
|
|
|
|
|
|
|
|
mat2x3 r23 = matrixCompMult(m23, m23);
|
|
|
|
mat2x4 r24 = matrixCompMult(m24, m24);
|
|
|
|
mat3x2 r32 = matrixCompMult(m32, m32);
|
|
|
|
mat3x4 r34 = matrixCompMult(m34, m34);
|
|
|
|
mat4x2 r42 = matrixCompMult(m42, m42);
|
|
|
|
mat4x3 r43 = matrixCompMult(m43, m43);
|
|
|
|
|
|
|
|
mat3x2 rfoo1 = matrixCompMult(m23, m32); // ERROR
|
|
|
|
mat3x4 rfoo2 = matrixCompMult(m34, m44); // ERROR
|
|
|
|
}
|
2014-06-03 00:20:41 +00:00
|
|
|
|
|
|
|
void matConst()
|
|
|
|
{
|
|
|
|
vec2 v2;
|
|
|
|
vec3 v3;
|
|
|
|
mat4 m4b1 = mat4(v2, v3); // ERROR, not enough
|
|
|
|
mat4 m4b2 = mat4(v2, v3, v3, v3, v3, v2, v2); // ERROR, too much
|
|
|
|
mat4 m4g = mat4(v2, v3, v3, v3, v3, v3);
|
|
|
|
mat4 m4 = mat4(v2, v3, v3, v3, v3, v2);
|
|
|
|
mat3 m3 = mat3(m4);
|
|
|
|
mat3 m3b1 = mat3(m4, v2); // ERROR, extra arg
|
|
|
|
mat3 m3b2 = mat3(m4, m4); // ERROR, extra arg
|
|
|
|
mat3x2 m32 = mat3x2(m4);
|
|
|
|
mat4 m4c = mat4(m32);
|
|
|
|
mat3 m3s = mat3(v2.x);
|
|
|
|
|
|
|
|
mat3 m3a1[2] = mat3[2](m3s, m3s);
|
|
|
|
mat3 m3a2[2] = mat3[2](m3s, m3s, m3s); // ERROR, too many args
|
|
|
|
}
|
2014-06-03 19:28:48 +00:00
|
|
|
|
|
|
|
uniform sampler3D s3D;
|
|
|
|
uniform sampler1D s1D;
|
|
|
|
uniform sampler2DShadow s2DS;
|
|
|
|
|
|
|
|
void foo2323()
|
|
|
|
{
|
|
|
|
vec4 v;
|
|
|
|
vec2 v2;
|
|
|
|
float f;
|
|
|
|
v = texture2DLod(s2D, v2, f); // ERROR
|
|
|
|
v = texture3DProjLod(s3D, v, f); // ERROR
|
|
|
|
v = texture1DProjLod(s1D, v, f); // ERROR
|
|
|
|
v = shadow2DProjLod(s2DS, v, f); // ERROR
|
2014-07-29 18:11:09 +00:00
|
|
|
|
|
|
|
v = texture1DGradARB(s1D, f, f, f); // ERROR
|
|
|
|
v = texture2DProjGradARB(s2D, v, v2, v2); // ERROR
|
|
|
|
v = shadow2DProjGradARB(s2DS, v, v2, v2); // ERROR
|
2014-06-03 19:28:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#extension GL_ARB_shader_texture_lod : require
|
|
|
|
|
|
|
|
void foo2324()
|
|
|
|
{
|
|
|
|
vec4 v;
|
|
|
|
vec2 v2;
|
|
|
|
float f;
|
|
|
|
v = texture2DLod(s2D, v2, f);
|
|
|
|
v = texture3DProjLod(s3D, v, f);
|
|
|
|
v = texture1DProjLod(s1D, v, f);
|
|
|
|
v = shadow2DProjLod(s2DS, v, f);
|
2014-07-29 18:11:09 +00:00
|
|
|
|
|
|
|
v = texture1DGradARB(s1D, f, f, f);
|
|
|
|
v = texture2DProjGradARB(s2D, v, v2, v2);
|
|
|
|
v = shadow2DProjGradARB(s2DS, v, v2, v2);
|
|
|
|
v = shadow2DRectProjGradARB(s2DS, v, v2, v2); // ERROR
|
2014-06-03 19:28:48 +00:00
|
|
|
}
|
2014-07-29 17:18:24 +00:00
|
|
|
|
2014-07-29 18:11:09 +00:00
|
|
|
uniform sampler2DRect s2DRbad; // ERROR
|
2014-07-29 17:18:24 +00:00
|
|
|
|
|
|
|
void foo121111()
|
|
|
|
{
|
|
|
|
vec2 v2;
|
|
|
|
vec4 v = texture2DRect(s2DRbad, v2);
|
|
|
|
}
|
|
|
|
|
|
|
|
#extension GL_ARB_texture_rectangle : enable
|
|
|
|
|
|
|
|
uniform sampler2DRect s2DR;
|
|
|
|
uniform sampler2DRectShadow s2DRS;
|
|
|
|
|
|
|
|
void foo12111()
|
|
|
|
{
|
|
|
|
vec2 v2;
|
|
|
|
vec3 v3;
|
|
|
|
vec4 v4;
|
|
|
|
vec4 v;
|
|
|
|
v = texture2DRect(s2DR, v2);
|
|
|
|
v = texture2DRectProj(s2DR, v3);
|
|
|
|
v = texture2DRectProj(s2DR, v4);
|
|
|
|
v = shadow2DRect(s2DRS, v3);
|
|
|
|
v = shadow2DRectProj(s2DRS, v4);
|
2014-07-29 18:11:09 +00:00
|
|
|
|
|
|
|
v = shadow2DRectProjGradARB(s2DRS, v, v2, v2);
|
2014-07-29 17:18:24 +00:00
|
|
|
}
|
2017-01-26 22:48:27 +00:00
|
|
|
|
|
|
|
void voidTernary()
|
|
|
|
{
|
|
|
|
bool b;
|
|
|
|
b ? foo121111() : foo12111();
|
|
|
|
b ? foo121111() : 4; // ERROR
|
|
|
|
b ? 3 : foo12111(); // ERROR
|
2017-02-28 19:40:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float halfFloat1 = 1.0h; // syntax ERROR
|