Newer
Older
John Kessenich
committed
#version 430 core
layout(location = 3) vec4 v4; // ERROR
layout(location = 4) uniform vec4 uv4;
John Kessenich
committed
layout(location = 2) in inb1 { vec4 v; } b1; // ERROR
layout(location = 2) out outb1 { vec4 v; } b2; // ERROR
out gl_PerVertex {
float gl_ClipDistance[];
};
void foo()
{
gl_ClipDistance[2] = 3.7;
}
John Kessenich
committed
struct sp {
highp float f;
in float g; // ERROR
uniform float h; // ERROR
invariant float i; // ERROR
volatile float j; // ERROR
layout(row_major) mat3 m3; // ERROR
};
void foo3(invariant vec4 v4, // ERROR
volatile vec3 v3,
layout(location = 3) vec2 v2, // ERROR
centroid vec3 cv3) // ERROR
{
}
struct S {
mat3x2 m[7]; // needs 7*3 locations
float f; // needs 1 location
}; // needs 22 locations
layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53
layout(location = 54) out float cf;
layout(location = 53) out float cg; // ERROR, collision at 31
layout(location = 10) in vec4 alias1;
layout(location = 10) in vec4 alias2; // okay for vertex input on desktop
John Kessenich
committed
out float gl_ClipDistance[17]; // ERROR, size too big
// enhanced_layouts (most tests are in 440.*)
layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR
layout(location = 28) in inblock2e {
layout(location = 25) float f2; // ERROR
} ininst2e;
in ublock4e {
layout(location = 50) float f1; // ERROR
layout(location = 51) float f2; // ERROR
} in4e;
layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR
layout(align=32) uniform ubl9e { // ERROR
layout(offset=12, align=4) float f; // ERROR
layout(offset=20) float g; // ERROR
} inst9e;
layout(std140) uniform blocke {
vec4 a;
layout(offset = 32) vec3 b; // ERROR
} spinste;
int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR
John Kessenich
committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR
out bblck2 {
layout(xfb_offset=64) vec4 bbv; // ERROR
} bbinst2;
layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR
layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR
layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR
layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR
vec4 bbv1;
vec4 bbv2;
} bbinst4e;
out bblck5e {
layout(xfb_offset=0) vec4 bbv1; // ERROR
layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR
} bbinst5e;
#extension GL_ARB_enhanced_layouts : enable
layout(align=16, std140) uniform ubl4 { int a; } inst4;
layout(std430) uniform;
layout(align=32) uniform ubl9 {
layout(offset=12, align=4) float f;
layout(offset=20) float g;
} inst9;
layout(std140) uniform block {
vec4 a; // a takes offsets 0-15
layout(offset = 32) vec3 b; // b takes offsets 32-43
} spinst;
int aconst[gl_MaxTransformFeedbackBuffers];
int bconst[gl_MaxTransformFeedbackInterleavedComponents];
const int start2 = 5;
layout(location = start2 * start2 - 2 - 4) in vec4 v6;
John Kessenich
committed
layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still...
John Kessenich
committed
bool b1;
float f1;
layout(location = 25) float f2;
} ininst2;
John Kessenich
committed
in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still...
John Kessenich
committed
layout(location = 50) float f1;
layout(location = 51) float f2;
} in4;
out bblck2g {
layout(xfb_offset=64) vec4 bbv;
} bbinst2g;
layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3
layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg;
layout( xfb_offset=32, xfb_stride=80) out vec4 bh;
layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 {
vec4 bbv1;
} bbinst4;
out bblck5 {
layout(xfb_offset=0) vec4 bbv1;
layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2;
} bbinst5;
John Kessenich
committed
John Kessenich
committed
void fooBarrier()
{
barrier(); // ERROR
memoryBarrier();
memoryBarrierAtomicCounter();
memoryBarrierBuffer();
memoryBarrierShared(); // ERROR
memoryBarrierImage();
groupMemoryBarrier(); // ERROR
}
John Kessenich
committed
buffer vec4 v; // ERROR
John Kessenich
committed
uniform sampler2DMS s2dms;
uniform usampler2DMSArray us2dmsa;
layout(rgba32i) uniform iimage2DMS ii2dms;
layout(rgba32f) uniform image2DMSArray i2dmsa;
void fooq()
{
int s = textureSamples(s2dms); // ERROR
s += textureSamples(us2dmsa); // ERROR
s += imageSamples(ii2dms); // ERROR
s += imageSamples(i2dmsa); // ERROR
}
#extension GL_ARB_shader_texture_image_samples : enable
void fooq2()
{
int s = textureSamples(s2dms);
s += textureSamples(us2dmsa);
s += imageSamples(ii2dms);
s += imageSamples(i2dmsa);
}
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
uniform sampler1D samp1D;
uniform usampler2D usamp2D;
uniform isampler3D isamp3D;
uniform isamplerCube isampCube;
uniform isampler1DArray isamp1DA;
uniform sampler2DArray samp2DA;
uniform usamplerCubeArray usampCubeA;
uniform sampler1DShadow samp1Ds;
uniform sampler2DShadow samp2Ds;
uniform samplerCubeShadow sampCubes;
uniform sampler1DArrayShadow samp1DAs;
uniform sampler2DArrayShadow samp2DAs;
uniform samplerCubeArrayShadow sampCubeAs;
uniform samplerBuffer sampBuf;
uniform sampler2DRect sampRect;
void qlod()
{
int levels;
levels = textureQueryLevels(samp1D);
levels = textureQueryLevels(usamp2D);
levels = textureQueryLevels(isamp3D);
levels = textureQueryLevels(isampCube);
levels = textureQueryLevels(isamp1DA);
levels = textureQueryLevels(samp2DA);
levels = textureQueryLevels(usampCubeA);
levels = textureQueryLevels(samp1Ds);
levels = textureQueryLevels(samp2Ds);
levels = textureQueryLevels(sampCubes);
levels = textureQueryLevels(samp1DAs);
levels = textureQueryLevels(samp2DAs);
levels = textureQueryLevels(sampCubeAs);
levels = textureQueryLevels(sampBuf); // ERROR
levels = textureQueryLevels(sampRect); // ERROR
}