2013-02-25 19:44:56 +00:00
|
|
|
#version 300 es
|
2014-10-06 19:39:13 +00:00
|
|
|
void nodef1(float f); // ERROR, no default precision
|
2013-02-25 19:44:56 +00:00
|
|
|
uniform sampler2D s2D;
|
2013-06-19 05:41:25 +00:00
|
|
|
uniform lowp sampler3D s3D;
|
2013-02-25 19:44:56 +00:00
|
|
|
uniform samplerCube sCube;
|
2013-06-19 05:41:25 +00:00
|
|
|
uniform lowp samplerCubeShadow sCubeShadow;
|
|
|
|
uniform lowp sampler2DShadow s2DShadow;
|
|
|
|
uniform lowp sampler2DArray s2DArray;
|
|
|
|
uniform lowp sampler2DArrayShadow s2DArrayShadow;
|
|
|
|
|
|
|
|
uniform lowp isampler2D is2D;
|
|
|
|
uniform lowp isampler3D is3D;
|
|
|
|
uniform lowp isamplerCube isCube;
|
|
|
|
uniform lowp isampler2DArray is2DArray;
|
|
|
|
|
|
|
|
uniform lowp usampler2D us2D;
|
|
|
|
uniform lowp usampler3D us3D;
|
|
|
|
uniform lowp usamplerCube usCube;
|
|
|
|
uniform lowp usampler2DArray us2DArray;
|
|
|
|
precision lowp float;
|
2013-02-25 19:44:56 +00:00
|
|
|
in float c1D;
|
|
|
|
in vec2 c2D;
|
|
|
|
in vec3 c3D;
|
2013-04-25 16:44:03 +00:00
|
|
|
smooth vec4 c4D;
|
2013-02-25 19:44:56 +00:00
|
|
|
|
2013-04-07 22:43:16 +00:00
|
|
|
flat in int ic1D;
|
|
|
|
flat in ivec2 ic2D;
|
|
|
|
flat in ivec3 ic3D;
|
|
|
|
flat in ivec4 ic4D;
|
2013-04-25 16:44:03 +00:00
|
|
|
noperspective in vec4 badv; // ERROR
|
2013-06-19 05:41:25 +00:00
|
|
|
in sampler2D bads; // ERROR
|
|
|
|
precision lowp uint; // ERROR
|
2013-04-07 22:43:16 +00:00
|
|
|
|
|
|
|
struct s {
|
|
|
|
int i;
|
2013-06-19 05:41:25 +00:00
|
|
|
sampler2D s;
|
2013-04-07 22:43:16 +00:00
|
|
|
};
|
|
|
|
|
2013-11-08 07:13:18 +00:00
|
|
|
in s badout; // ERROR, can't contain a sampler
|
2015-12-22 23:39:07 +00:00
|
|
|
// ERROR, can't have int in struct without flat
|
2013-06-21 19:43:44 +00:00
|
|
|
struct S2 {
|
|
|
|
vec3 c;
|
|
|
|
float f;
|
|
|
|
};
|
|
|
|
|
|
|
|
in S2 s2;
|
|
|
|
|
|
|
|
out vec3 sc;
|
|
|
|
out float sf;
|
|
|
|
|
2013-06-24 21:52:41 +00:00
|
|
|
uniform sampler2D arrayedSampler[5];
|
|
|
|
|
2013-02-25 19:44:56 +00:00
|
|
|
void main()
|
|
|
|
{
|
2013-02-26 19:48:48 +00:00
|
|
|
float f;
|
|
|
|
vec4 v;
|
|
|
|
v = texture(s2D, c2D);
|
|
|
|
v = textureProj(s3D, c4D);
|
|
|
|
v = textureLod(s2DArray, c3D, 1.2);
|
2013-11-20 23:46:57 +00:00
|
|
|
f = textureOffset(s2DShadow, c3D, ic2D, c1D); // ERROR, offset argument not constant
|
2013-02-26 19:48:48 +00:00
|
|
|
v = texelFetch(s3D, ic3D, ic1D);
|
2015-08-19 05:17:15 +00:00
|
|
|
v = texelFetchOffset(arrayedSampler[2], ic2D, 4, ic2D); // ERROR, offset argument not constant
|
2013-02-26 19:48:48 +00:00
|
|
|
f = textureLodOffset(s2DShadow, c3D, c1D, ic2D);
|
|
|
|
v = textureProjLodOffset(s2D, c3D, c1D, ic2D);
|
|
|
|
v = textureGrad(sCube, c3D, c3D, c3D);
|
|
|
|
f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
|
|
|
|
v = textureProjGrad(s3D, c4D, c3D, c3D);
|
|
|
|
v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
|
2013-06-24 21:52:41 +00:00
|
|
|
v = texture(arrayedSampler[ic1D], c2D); // ERROR
|
2013-02-26 19:48:48 +00:00
|
|
|
|
|
|
|
ivec4 iv;
|
|
|
|
iv = texture(is2D, c2D);
|
|
|
|
iv = textureProjOffset(is2D, c4D, ic2D);
|
|
|
|
iv = textureProjLod(is2D, c3D, c1D);
|
|
|
|
iv = textureProjGrad(is2D, c3D, c2D, c2D);
|
|
|
|
iv = texture(is3D, c3D, 4.2);
|
|
|
|
iv = textureLod(isCube, c3D, c1D);
|
|
|
|
iv = texelFetch(is2DArray, ic3D, ic1D);
|
|
|
|
|
|
|
|
iv.xy = textureSize(sCubeShadow, 2);
|
2013-04-25 16:44:03 +00:00
|
|
|
|
|
|
|
float precise;
|
|
|
|
double boo; // ERROR
|
|
|
|
dvec2 boo2; // ERROR
|
|
|
|
dvec3 boo3; // ERROR
|
|
|
|
dvec4 boo4; // ERROR
|
2013-06-07 18:54:19 +00:00
|
|
|
|
|
|
|
f += gl_FragCoord.y;
|
|
|
|
gl_FragDepth = f;
|
2013-06-21 19:43:44 +00:00
|
|
|
|
|
|
|
sc = s2.c;
|
|
|
|
sf = s2.f;
|
2013-06-24 22:40:19 +00:00
|
|
|
|
|
|
|
sinh(c1D) +
|
|
|
|
cosh(c1D) * tanh(c2D);
|
|
|
|
asinh(c4D) + acosh(c4D);
|
|
|
|
atanh(c3D);
|
2013-02-25 19:44:56 +00:00
|
|
|
}
|
2013-04-25 16:44:03 +00:00
|
|
|
|
2013-06-26 05:54:40 +00:00
|
|
|
uniform multi {
|
|
|
|
int[2] a[3]; // ERROR
|
|
|
|
int[2][3] b; // ERROR
|
|
|
|
int c[2][3]; // ERROR
|
|
|
|
} multiInst[2][3]; // ERROR
|
|
|
|
|
2013-11-05 18:07:25 +00:00
|
|
|
out vec4 colors[4];
|
|
|
|
|
|
|
|
void foo()
|
|
|
|
{
|
|
|
|
colors[2] = c4D;
|
2013-11-08 07:13:18 +00:00
|
|
|
colors[ic1D] = c4D; // ERROR
|
|
|
|
}
|
|
|
|
|
|
|
|
uniform s st1;
|
|
|
|
uniform s st2;
|
|
|
|
|
|
|
|
void foo13(s inSt2)
|
|
|
|
{
|
|
|
|
if (st1 == st2); // ERROR
|
|
|
|
if (st1 != st2); // ERROR
|
|
|
|
st1.s == st2.s; // ERROR
|
|
|
|
inSt2 = st1; // ERROR
|
|
|
|
inSt2 == st1; // ERROR
|
2013-11-05 18:07:25 +00:00
|
|
|
}
|
|
|
|
|
2013-11-20 23:46:57 +00:00
|
|
|
void foo23()
|
|
|
|
{
|
|
|
|
textureOffset(s2DShadow, c3D, ivec2(-8, 7), c1D);
|
|
|
|
textureOffset(s2DShadow, c3D, ivec2(-9, 8), c1D);
|
|
|
|
}
|
|
|
|
|
2013-12-02 16:38:53 +00:00
|
|
|
void foo324(void)
|
|
|
|
{
|
|
|
|
float p = pow(3.2, 4.6);
|
|
|
|
p += sin(0.4);
|
2013-12-03 01:18:06 +00:00
|
|
|
p += distance(vec2(10.0, 11.0), vec2(13.0, 15.0)); // 5
|
|
|
|
p += dot(vec3(2,3,5), vec3(-2,-1,4)); // 13
|
|
|
|
vec3 c3 = cross(vec3(3,-3,1), vec3(4,9,2)); // (-15, -2, 39)
|
|
|
|
c3 += faceforward(vec3(1,2,3), vec3(2,3,5), vec3(-2,-1,4)); // (-1,-2,-3)
|
|
|
|
c3 += faceforward(vec3(1,2,3), vec3(-2,-3,-5), vec3(-2,-1,4)); // (1,2,3)
|
|
|
|
vec2 c2 = reflect(vec2(1,3), vec2(0,1)); // (1,-3)
|
|
|
|
c2 += refract(vec2(1,3), vec2(0,1), 1.0); // (1,-3)
|
|
|
|
c2 += refract(vec2(1,3), vec2(0,1), 3.0);
|
|
|
|
c2 += refract(vec2(1,0.1), vec2(0,1), 5.0); // (0,0)
|
|
|
|
mat3x2 m32 = outerProduct(vec2(2,3), vec3(5,7,11));// rows: (10, 14, 22), (15, 21, 33)
|
2013-12-02 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
2014-01-28 21:13:59 +00:00
|
|
|
uniform mediump; // ERROR
|
|
|
|
|
2014-08-14 07:07:21 +00:00
|
|
|
layout(early_fragment_tests) in; // ERROR
|
|
|
|
|
2020-05-01 04:41:33 +00:00
|
|
|
// Test extension GL_EXT_shader_integer_mix
|
|
|
|
#extension GL_EXT_shader_integer_mix : enable
|
|
|
|
bool b1, b2, b;
|
|
|
|
int x,y;
|
|
|
|
uint z,w;
|
|
|
|
|
|
|
|
void testmix()
|
|
|
|
{
|
|
|
|
int ival = mix(x, y, b);
|
|
|
|
ivec2 iv2 = mix(ivec2(x), ivec2(y), bvec2(b));
|
|
|
|
ivec3 iv3 = mix(ivec3(x), ivec3(y), bvec3(b));
|
|
|
|
ivec4 iv4 = mix(ivec4(x), ivec4(x), bvec4(b));
|
|
|
|
uint uiv = mix(z, w, b);
|
|
|
|
uvec2 uv2 = mix(uvec2(z), uvec2(z), bvec2(b));
|
|
|
|
uvec3 uv3 = mix(uvec3(z), uvec3(z), bvec3(b));
|
|
|
|
uvec4 uv4 = mix(uvec4(z), uvec4(z), bvec4(b));
|
|
|
|
bool bv = mix(b1, b2, b);
|
|
|
|
bvec2 bv2 = mix(bvec2(b1), bvec2(b2), bvec2(b));
|
|
|
|
bvec3 bv3 = mix(bvec3(b1), bvec3(b2), bvec3(b));
|
|
|
|
bvec4 bv4 = mix(bvec4(b1), bvec4(b2), bvec4(b));
|
|
|
|
}
|
|
|
|
|
|
|
|
#extension GL_EXT_shader_integer_mix : disable
|
|
|
|
void testmixFail()
|
|
|
|
{
|
|
|
|
int ival = mix(x, y, b); // Error since extenson GL_EXT_shader_integer_mix is disabled
|
|
|
|
}
|
|
|
|
|
2020-04-21 18:33:57 +00:00
|
|
|
// Test layout qualifier "index" with extension GL_EXT_blend_func_extended
|
|
|
|
layout(location = 0, index = 1) out vec4 outVarFail; // Error Index supported with extension GL_EXT_blend_func_extended enabled
|
|
|
|
#extension GL_EXT_blend_func_extended : enable
|
|
|
|
layout(location = 0, index = 2) out vec4 outVarPass;
|
|
|
|
|
2014-10-08 16:31:44 +00:00
|
|
|
#ifndef GL_FRAGMENT_PRECISION_HIGH
|
|
|
|
#error missing GL_FRAGMENT_PRECISION_HIGH
|
|
|
|
#endif
|
|
|
|
|
2014-10-08 21:29:29 +00:00
|
|
|
invariant in; // ERROR
|
|
|
|
invariant in vec4; // ERROR
|
|
|
|
invariant in vec4 fooinv; // ERROR
|
|
|
|
|
2013-04-25 16:44:03 +00:00
|
|
|
float imageBuffer; // ERROR, reserved
|
|
|
|
float uimage2DRect; // ERROR, reserved
|