1#version 430 core 2 3layout(location = 3) vec4 v4; // ERROR 4 5layout(location = 4) uniform vec4 uv4; 6 7layout(location = 2) in inb1 { vec4 v; } b1; // ERROR 8layout(location = 2) out outb1 { vec4 v; } b2; // ERROR 9 10out gl_PerVertex { 11 float gl_ClipDistance[]; 12}; 13 14void foo() 15{ 16 gl_ClipDistance[2] = 3.7; 17} 18 19struct sp { 20 highp float f; 21 in float g; // ERROR 22 uniform float h; // ERROR 23 invariant float i; // ERROR 24 volatile float j; // ERROR 25 layout(row_major) mat3 m3; // ERROR 26}; 27 28void foo3(invariant vec4 v4, // ERROR 29 volatile vec3 v3, 30 layout(location = 3) vec2 v2, // ERROR 31 centroid vec3 cv3) // ERROR 32{ 33} 34 35struct S { 36 mat3x2 m[7]; // needs 7*3 locations 37 float f; // needs 1 location 38}; // needs 22 locations 39 40layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53 41layout(location = 54) out float cf; 42layout(location = 53) out float cg; // ERROR, collision at 31 43 44layout(location = 10) in vec4 alias1; 45layout(location = 10) in vec4 alias2; // okay for vertex input on desktop 46 47out float gl_ClipDistance[17]; // ERROR, size too big 48 49// enhanced_layouts (most tests are in 440.*) 50 51layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR 52 53layout(location = 28) in inblock2e { 54 layout(location = 25) float f2; // ERROR 55} ininst2e; 56 57in ublock4e { 58 layout(location = 50) float f1; // ERROR 59 layout(location = 51) float f2; // ERROR 60} in4e; 61 62layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR 63 64layout(align=32) uniform ubl9e { // ERROR 65 layout(offset=12, align=4) float f; // ERROR 66 layout(offset=20) float g; // ERROR 67} inst9e; 68 69layout(std140) uniform blocke { 70 vec4 a; 71 layout(offset = 32) vec3 b; // ERROR 72} spinste; 73 74int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR 75int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR 76 77out bblck2 { 78 layout(xfb_offset=64) vec4 bbv; // ERROR 79} bbinst2; 80 81layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR 82 83layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR 84layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR 85 86layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR 87 vec4 bbv1; 88 vec4 bbv2; 89} bbinst4e; 90 91out bblck5e { 92 layout(xfb_offset=0) vec4 bbv1; // ERROR 93 layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR 94} bbinst5e; 95 96#extension GL_ARB_enhanced_layouts : enable 97 98layout(align=16, std140) uniform ubl4 { int a; } inst4; 99layout(std430) uniform; 100 101layout(align=32) uniform ubl9 { 102 layout(offset=12, align=4) float f; 103 layout(offset=20) float g; 104} inst9; 105 106layout(std140) uniform block { 107 vec4 a; // a takes offsets 0-15 108 layout(offset = 32) vec3 b; // b takes offsets 32-43 109} spinst; 110 111int aconst[gl_MaxTransformFeedbackBuffers]; 112int bconst[gl_MaxTransformFeedbackInterleavedComponents]; 113 114const int start2 = 5; 115layout(location = start2 * start2 - 2 - 4) in vec4 v6; 116 117layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still... 118 bool b1; 119 float f1; 120 layout(location = 25) float f2; 121} ininst2; 122 123in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still... 124 layout(location = 50) float f1; 125 layout(location = 51) float f2; 126} in4; 127 128out bblck2g { 129 layout(xfb_offset=64) vec4 bbv; 130} bbinst2g; 131 132layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3 133 134layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg; 135layout( xfb_offset=32, xfb_stride=80) out vec4 bh; 136 137layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 { 138 vec4 bbv1; 139} bbinst4; 140 141out bblck5 { 142 layout(xfb_offset=0) vec4 bbv1; 143 layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2; 144} bbinst5; 145 146shared vec4 sharedv; // ERROR 147 148void fooBarrier() 149{ 150 barrier(); // ERROR 151 memoryBarrier(); 152 memoryBarrierAtomicCounter(); 153 memoryBarrierBuffer(); 154 memoryBarrierShared(); // ERROR 155 memoryBarrierImage(); 156 groupMemoryBarrier(); // ERROR 157} 158 159buffer vec4 v; // ERROR 160 161uniform sampler2DMS s2dms; 162uniform usampler2DMSArray us2dmsa; 163layout(rgba32i) uniform iimage2DMS ii2dms; 164layout(rgba32f) uniform image2DMSArray i2dmsa; 165 166void fooq() 167{ 168 int s = textureSamples(s2dms); // ERROR 169 s += textureSamples(us2dmsa); // ERROR 170 s += imageSamples(ii2dms); // ERROR 171 s += imageSamples(i2dmsa); // ERROR 172} 173 174#extension GL_ARB_shader_texture_image_samples : enable 175 176void fooq2() 177{ 178 int s = textureSamples(s2dms); 179 s += textureSamples(us2dmsa); 180 s += imageSamples(ii2dms); 181 s += imageSamples(i2dmsa); 182} 183 184uniform sampler1D samp1D; 185uniform usampler2D usamp2D; 186uniform isampler3D isamp3D; 187uniform isamplerCube isampCube; 188uniform isampler1DArray isamp1DA; 189uniform sampler2DArray samp2DA; 190uniform usamplerCubeArray usampCubeA; 191 192uniform sampler1DShadow samp1Ds; 193uniform sampler2DShadow samp2Ds; 194uniform samplerCubeShadow sampCubes; 195uniform sampler1DArrayShadow samp1DAs; 196uniform sampler2DArrayShadow samp2DAs; 197uniform samplerCubeArrayShadow sampCubeAs; 198 199uniform samplerBuffer sampBuf; 200uniform sampler2DRect sampRect; 201 202void qlod() 203{ 204 int levels; 205 206 levels = textureQueryLevels(samp1D); 207 levels = textureQueryLevels(usamp2D); 208 levels = textureQueryLevels(isamp3D); 209 levels = textureQueryLevels(isampCube); 210 levels = textureQueryLevels(isamp1DA); 211 levels = textureQueryLevels(samp2DA); 212 levels = textureQueryLevels(usampCubeA); 213 214 levels = textureQueryLevels(samp1Ds); 215 levels = textureQueryLevels(samp2Ds); 216 levels = textureQueryLevels(sampCubes); 217 levels = textureQueryLevels(samp1DAs); 218 levels = textureQueryLevels(samp2DAs); 219 levels = textureQueryLevels(sampCubeAs); 220 221 levels = textureQueryLevels(sampBuf); // ERROR 222 levels = textureQueryLevels(sampRect); // ERROR 223} 224