John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 1 | #version 130 |
| 2 | |
| 3 | lowp vec3 a; |
| 4 | mediump float b; |
| 5 | highp int c; |
| 6 | |
| 7 | precision highp float; |
| 8 | |
| 9 | in vec4 i; |
| 10 | out vec4 o; |
| 11 | |
John Kessenich | 01fc064 | 2013-06-24 21:22:03 +0000 | [diff] [blame] | 12 | flat in float fflat; |
| 13 | smooth in float fsmooth; |
| 14 | noperspective in float fnop; |
John Kessenich | c2ff770 | 2013-04-25 16:44:03 +0000 | [diff] [blame] | 15 | |
John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 16 | void main() |
| 17 | { |
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 18 | float clip = gl_ClipDistance[3]; |
John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 19 | } |
John Kessenich | 21a8770 | 2013-10-21 19:25:59 +0000 | [diff] [blame] | 20 | |
| 21 | uniform samplerCube sampC; |
| 22 | |
| 23 | void foo() |
| 24 | { |
| 25 | vec4 s = textureGather(sampC, vec3(0.2)); |
| 26 | } |
| 27 | |
| 28 | #extension GL_ARB_texture_gather : enable |
| 29 | |
| 30 | void bar() |
| 31 | { |
| 32 | vec4 s = textureGather(sampC, vec3(0.2)); |
| 33 | } |
John Kessenich | 8ec55cd | 2013-11-05 18:07:25 +0000 | [diff] [blame] | 34 | |
| 35 | flat in vec3 gl_Color; // ERROR, type |
| 36 | in vec4 gl_Color; |
| 37 | flat in vec4 gl_Color; |
| 38 | flat in vec4 gl_Color[2]; // ERROR, array |
| 39 | vec4 gl_Color; // ERROR, storage |
John Kessenich | b0a7eb5 | 2013-11-07 17:44:20 +0000 | [diff] [blame] | 40 | |
| 41 | #extension GL_ARB_texture_gather : warn |
| 42 | |
John Kessenich | c999ba2 | 2013-11-07 23:33:24 +0000 | [diff] [blame] | 43 | void bar2() |
John Kessenich | b0a7eb5 | 2013-11-07 17:44:20 +0000 | [diff] [blame] | 44 | { |
| 45 | vec4 s = textureGather(sampC, vec3(0.2)); |
John Kessenich | 77d908a | 2013-11-09 00:18:22 +0000 | [diff] [blame] | 46 | |
| 47 | uvec3 uv3; |
| 48 | bvec3 b3; |
| 49 | b3 = lessThan(uv3, uv3); |
| 50 | b3 = equal(uv3, uv3); |
| 51 | const bvec2 bl1 = greaterThanEqual(uvec2(2, 3), uvec2(3,3)); |
| 52 | const bvec2 bl2 = equal(uvec2(2, 3), uvec2(3,3)); |
| 53 | const bvec2 bl3 = equal(bl1, bl2); // yes, equal |
| 54 | int a1[int(bl3.x)]; |
| 55 | int a2[int(bl3.y)]; |
| 56 | a1[0]; // size 1 |
| 57 | a2[0]; // size 1 |
| 58 | const bvec4 bl4 = notEqual(greaterThan(uvec4(1,2,3,4), uvec4(0,2,0,6)), lessThanEqual(uvec4(7,8,9,10), uvec4(6, 8, 0, 11))); // compare (t,f,t,f) with (f,t,f,t) |
| 59 | int a3[int(bl4.x)+int(bl4.y)+int(bl4.z)+int(bl4.w)]; |
| 60 | a3[3]; // size 4 |
| 61 | b3 != b3; |
| 62 | b3 < b3; // ERROR |
| 63 | uv3 > uv3; // ERROR |
| 64 | uvec2(2, 3) >= uvec2(3,3); // ERROR |
| 65 | int(bl4) <= int(bl4); // true |
| 66 | int(bl4.x) > int(bl4.y); // false |
John Kessenich | b0a7eb5 | 2013-11-07 17:44:20 +0000 | [diff] [blame] | 67 | } |
John Kessenich | d6bef91 | 2013-11-23 21:10:51 +0000 | [diff] [blame] | 68 | |
| 69 | #extension GL_ARB_texture_gather : enable |
| 70 | #extension GL_ARB_texture_rectangle : enable |
| 71 | |
| 72 | uniform sampler2D samp2D; |
| 73 | uniform sampler2DShadow samp2DS; |
| 74 | uniform sampler2DRect samp2DR; |
| 75 | uniform sampler2DArray samp2DA; |
| 76 | |
| 77 | void bar23() |
| 78 | { |
| 79 | vec4 s; |
| 80 | s = textureGatherOffset(sampC, vec3(0.3), ivec2(1)); // ERROR |
| 81 | s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); // ERROR |
| 82 | s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); |
| 83 | s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); |
| 84 | s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); // ERROR |
| 85 | s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); // ERROR |
| 86 | } |
| 87 | |
| 88 | #extension GL_ARB_gpu_shader5 : enable |
| 89 | |
| 90 | void bar234() |
| 91 | { |
| 92 | vec4 s; |
| 93 | s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); |
| 94 | s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); |
| 95 | s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); |
| 96 | s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); |
| 97 | s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); |
| 98 | } |
John Kessenich | e5fbec8 | 2014-01-26 22:22:54 +0000 | [diff] [blame] | 99 | |
| 100 | #extension GL_ARB_texture_cube_map_array : enable |
| 101 | |
| 102 | uniform samplerCubeArray Sca; |
| 103 | uniform isamplerCubeArray Isca; |
| 104 | uniform usamplerCubeArray Usca; |
| 105 | uniform samplerCubeArrayShadow Scas; |
| 106 | |
| 107 | void bar235() |
| 108 | { |
| 109 | ivec3 a = textureSize(Sca, 3); |
| 110 | vec4 b = texture(Sca, i); |
| 111 | ivec4 c = texture(Isca, i, 0.7); |
| 112 | uvec4 d = texture(Usca, i); |
| 113 | |
| 114 | b = textureLod(Sca, i, 1.7); |
| 115 | a = textureSize(Scas, a.x); |
| 116 | float f = texture(Scas, i, b.y); |
| 117 | c = textureGrad(Isca, i, vec3(0.1), vec3(0.2)); |
| 118 | } |
John Kessenich | 782aa83 | 2014-02-12 05:15:49 +0000 | [diff] [blame] | 119 | |
| 120 | #extension GL_ARB_shading_language_420pack : enable |
| 121 | |
| 122 | const int ai[3] = { 10, 23, 32 }; |
| 123 | layout(binding=0) uniform blockname { int a; } instanceName; // ERROR |
| 124 | uniform layout(binding=0) sampler2D bounds; |
| 125 | |
| 126 | void bar23444() |
| 127 | { |
| 128 | mat4x3 m43; |
| 129 | float a1 = m43[3].y; |
| 130 | int a2 = m43.length(); // ERROR until shading_language_420pack is fully implemented |
| 131 | const float b = 2 * a1; |
| 132 | a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; // ERROR until shading_language_420pack is fully implemented |
| 133 | } |