John Kessenich | 21a8770 | 2013-10-21 19:25:59 +0000 | [diff] [blame] | 1 | #version 400 core |
John Kessenich | eebed6f | 2013-06-24 21:52:41 +0000 | [diff] [blame] | 2 | |
| 3 | in vec2 c2D; |
| 4 | flat in int i; |
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 5 | out vec4 outp; |
John Kessenich | eebed6f | 2013-06-24 21:52:41 +0000 | [diff] [blame] | 6 | uniform sampler2D arrayedSampler[5]; |
John Kessenich | 21a8770 | 2013-10-21 19:25:59 +0000 | [diff] [blame] | 7 | uniform usampler2DRect samp2dr; |
| 8 | uniform isampler2DArray isamp2DA; |
John Kessenich | eebed6f | 2013-06-24 21:52:41 +0000 | [diff] [blame] | 9 | |
| 10 | void main() |
| 11 | { |
| 12 | vec4 v; |
| 13 | v = texture(arrayedSampler[i], c2D); |
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 14 | outp.x = gl_ClipDistance[1]; |
John Kessenich | 21a8770 | 2013-10-21 19:25:59 +0000 | [diff] [blame] | 15 | |
| 16 | ivec2 offsets[4]; |
John Kessenich | d6bef91 | 2013-11-23 21:10:51 +0000 | [diff] [blame] | 17 | 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 Kessenich | 21a8770 | 2013-10-21 19:25:59 +0000 | [diff] [blame] | 20 | 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 Kessenich | 8ec55cd | 2013-11-05 18:07:25 +0000 | [diff] [blame] | 26 | |
| 27 | vec4 c = gl_FragCoord; |
John Kessenich | eebed6f | 2013-06-24 21:52:41 +0000 | [diff] [blame] | 28 | } |
John Kessenich | c78a126 | 2013-10-22 00:21:04 +0000 | [diff] [blame] | 29 | |
| 30 | layout(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 Kessenich | 0b39137 | 2013-12-05 20:07:56 +0000 | [diff] [blame] | 36 | layout(location = 6) in vec4 vl2; |
John Kessenich | c78a126 | 2013-10-22 00:21:04 +0000 | [diff] [blame] | 37 | |
| 38 | layout(location = 3) uniform vec3 uv3; |
John Kessenich | 8ec55cd | 2013-11-05 18:07:25 +0000 | [diff] [blame] | 39 | |
| 40 | layout(location = 5) in vec4 gl_Color; // ERROR, layout |
| 41 | noperspective in float gl_ClipDistance[4]; // ERROR, can't change qualifier |
| 42 | |
John Kessenich | 5134b9c | 2013-11-20 21:12:43 +0000 | [diff] [blame] | 43 | layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use |
John Kessenich | 1d1132d | 2013-11-20 23:46:57 +0000 | [diff] [blame] | 44 | |
| 45 | uniform sampler2DRectShadow u2drs; |
| 46 | |
| 47 | void foo23() |
| 48 | { |
| 49 | const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); |
| 50 | |
John Kessenich | d6bef91 | 2013-11-23 21:10:51 +0000 | [diff] [blame] | 51 | textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant |
John Kessenich | 1d1132d | 2013-11-20 23:46:57 +0000 | [diff] [blame] | 52 | textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); |
John Kessenich | d6bef91 | 2013-11-23 21:10:51 +0000 | [diff] [blame] | 53 | textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range |
John Kessenich | 1d1132d | 2013-11-20 23:46:57 +0000 | [diff] [blame] | 54 | textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range |
| 55 | } |
John Kessenich | 116c30b | 2013-12-12 01:25:37 +0000 | [diff] [blame] | 56 | |
| 57 | patch in vec4 patchIn; // ERROR |
| 58 | patch out vec4 patchOut; // ERROR |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 59 | |
| 60 | void foo24() |
| 61 | { |
| 62 | dvec3 df, di; |
| 63 | df = modf(outp.xyz, di); |
| 64 | } |