blob: e0b14d7fb980036cda0b35a0f162a0d0077ab5b8 [file] [log] [blame]
John Kessenich21a87702013-10-21 19:25:59 +00001#version 400 core
John Kessenicheebed6f2013-06-24 21:52:41 +00002
3in vec2 c2D;
4flat in int i;
John Kesseniche7c59c12013-10-16 22:28:35 +00005out vec4 outp;
John Kessenicheebed6f2013-06-24 21:52:41 +00006uniform sampler2D arrayedSampler[5];
John Kessenich21a87702013-10-21 19:25:59 +00007uniform usampler2DRect samp2dr;
8uniform isampler2DArray isamp2DA;
John Kessenicheebed6f2013-06-24 21:52:41 +00009
10void main()
11{
12 vec4 v;
13 v = texture(arrayedSampler[i], c2D);
John Kesseniche7c59c12013-10-16 22:28:35 +000014 outp.x = gl_ClipDistance[1];
John Kessenich21a87702013-10-21 19:25:59 +000015
16 ivec2 offsets[4];
John Kessenichd6bef912013-11-23 21:10:51 +000017 const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0));
18 uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2); // ERROR, offsets not constant
19 uv4 = textureGatherOffsets(samp2dr, c2D, constOffsets, 2);
John Kessenich21a87702013-10-21 19:25:59 +000020 vec4 v4 = textureGather(arrayedSampler[0], c2D);
21 ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3);
22 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i); // ERROR, last argument not const
23 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4); // ERROR, last argument out of range
24 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2);
25 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i));
John Kessenich8ec55cd2013-11-05 18:07:25 +000026
27 vec4 c = gl_FragCoord;
John Kessenicheebed6f2013-06-24 21:52:41 +000028}
John Kessenichc78a1262013-10-22 00:21:04 +000029
30layout(location = 4) in vec4 vl; // ERROR, not supported
31
32#ifdef GL_ARB_separate_shader_objects
33#extension GL_ARB_separate_shader_objects : enable
34#endif
35
John Kessenich0b391372013-12-05 20:07:56 +000036layout(location = 6) in vec4 vl2;
John Kessenichc78a1262013-10-22 00:21:04 +000037
38layout(location = 3) uniform vec3 uv3;
John Kessenich8ec55cd2013-11-05 18:07:25 +000039
40layout(location = 5) in vec4 gl_Color; // ERROR, layout
41noperspective in float gl_ClipDistance[4]; // ERROR, can't change qualifier
42
John Kessenich5134b9c2013-11-20 21:12:43 +000043layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use
John Kessenich1d1132d2013-11-20 23:46:57 +000044
45uniform sampler2DRectShadow u2drs;
46
47void foo23()
48{
49 const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16));
50
John Kessenichd6bef912013-11-23 21:10:51 +000051 textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant
John Kessenich1d1132d2013-11-20 23:46:57 +000052 textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]);
John Kessenichd6bef912013-11-23 21:10:51 +000053 textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range
John Kessenich1d1132d2013-11-20 23:46:57 +000054 textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range
55}
John Kessenich116c30b2013-12-12 01:25:37 +000056
57patch in vec4 patchIn; // ERROR
58patch out vec4 patchOut; // ERROR
John Kessenichf5dd2f52014-03-26 03:17:31 +000059
60void foo24()
61{
62 dvec3 df, di;
63 df = modf(outp.xyz, di);
64}