Turn on ESSL 3.1 for most features:
- images: load/store, memory qualifiers - buffer blocks - compute shaders - atomic counters - texture gather - SSO - uniform locations - all the numeric-based version # comparisons git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27710 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
bedb1bc2db
commit
4d57090da5
20 changed files with 500 additions and 195 deletions
141
Test/310.comp
Normal file
141
Test/310.comp
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
#version 310 es
|
||||
|
||||
layout(local_size_x = 2) in;
|
||||
layout(local_size_x = 16) in; // ERROR, changing
|
||||
layout(local_size_z = 4096) in; // ERROR, too large
|
||||
layout(local_size_x = 2) in;
|
||||
|
||||
const int total = gl_MaxComputeWorkGroupCount.y
|
||||
+ gl_MaxComputeUniformComponents
|
||||
+ gl_MaxComputeTextureImageUnits
|
||||
+ gl_MaxComputeImageUniforms
|
||||
+ gl_MaxComputeAtomicCounters
|
||||
+ gl_MaxComputeAtomicCounterBuffers;
|
||||
|
||||
buffer ShaderStorageBlock
|
||||
{
|
||||
int value;
|
||||
float values[];
|
||||
};
|
||||
|
||||
buffer InvalidShaderStorageBlock
|
||||
{
|
||||
float values[]; // ERROR
|
||||
int value;
|
||||
} invalid;
|
||||
|
||||
void main()
|
||||
{
|
||||
barrier();
|
||||
memoryBarrier();
|
||||
memoryBarrierAtomicCounter();
|
||||
memoryBarrierBuffer();
|
||||
memoryBarrierShared();
|
||||
memoryBarrierImage();
|
||||
groupMemoryBarrier();
|
||||
value = int(values[gl_LocalInvocationIndex]);
|
||||
}
|
||||
|
||||
layout(location = 2) in vec3 v3; // ERROR
|
||||
in float f; // ERROR
|
||||
out float fo; // ERROR
|
||||
|
||||
shared vec4 s;
|
||||
layout(location = 2) shared vec4 sl; // ERROR
|
||||
shared float fs = 4.2; // ERROR
|
||||
|
||||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
|
||||
|
||||
int arrX[gl_WorkGroupSize.x];
|
||||
int arrY[gl_WorkGroupSize.y];
|
||||
int arrZ[gl_WorkGroupSize.z];
|
||||
|
||||
readonly buffer roblock
|
||||
{
|
||||
int value;
|
||||
float values[];
|
||||
} ro;
|
||||
|
||||
void foo()
|
||||
{
|
||||
ro.values[2] = 4.7; // ERROR, readonly
|
||||
ro.values.length();
|
||||
++s;
|
||||
}
|
||||
|
||||
buffer vec4 v; // ERROR
|
||||
|
||||
uniform usampler2D us2dbad; // ERROR, default precision
|
||||
|
||||
precision highp usampler2D;
|
||||
precision highp iimage2DArray;
|
||||
precision highp iimage2D;
|
||||
|
||||
uniform usampler2D us2d;
|
||||
|
||||
uniform iimage2DArray ii2dabad; // ERROR, not writeonly
|
||||
uniform writeonly iimage2DArray ii2da;
|
||||
|
||||
layout(r32i) uniform iimage2D iimg2D;
|
||||
layout(rgba32i) uniform iimage2D iimg2Drgba;
|
||||
layout(rgba32f) uniform image2D img2Drgba;
|
||||
layout(r32ui) uniform uimage2D uimg2D;
|
||||
|
||||
void qux()
|
||||
{
|
||||
int i = 4;
|
||||
imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310
|
||||
imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310
|
||||
imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout
|
||||
imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image
|
||||
ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
|
||||
imageStore(ii2da, ivec3(i,i,i), ivec4(0));
|
||||
imageLoad(img2Drgba, ivec2(i,i));
|
||||
imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly
|
||||
}
|
||||
|
||||
volatile float vol; // ERROR, not an image
|
||||
readonly int vol2; // ERROR, not an image
|
||||
|
||||
void passr(coherent readonly iimage2D image)
|
||||
{
|
||||
}
|
||||
|
||||
layout(r32i) coherent readonly uniform iimage2D qualim1;
|
||||
layout(r32i) coherent restrict readonly uniform iimage2D qualim2;
|
||||
|
||||
void passrc()
|
||||
{
|
||||
passr(qualim1);
|
||||
passr(qualim2); // ERROR, drops restrict
|
||||
passr(iimg2D);
|
||||
}
|
||||
|
||||
layout(rg8i) uniform uimage2D i1bad; // ERROR, type mismatch
|
||||
layout(rgba32i) uniform image2D i2bad; // ERROR, type mismatch
|
||||
layout(rgba32f) uniform uimage2D i3bad; // ERROR, type mismatch
|
||||
layout(r8_snorm) uniform iimage2D i4bad; // ERROR, type mismatch
|
||||
layout(rgba32ui) uniform iimage2D i5bad; // ERROR, type mismatch
|
||||
layout(r8ui) uniform iimage2D i6bad; // ERROR, type mismatch
|
||||
|
||||
layout(binding = 0) uniform atomic_uint counter;
|
||||
|
||||
uint func(atomic_uint c)
|
||||
{
|
||||
return atomicCounterIncrement(c);
|
||||
}
|
||||
|
||||
uint func2(out atomic_uint c) // ERROR, output
|
||||
{
|
||||
return counter; // ERROR, type mismatch
|
||||
return atomicCounter(counter);
|
||||
}
|
||||
|
||||
void mainAC()
|
||||
{
|
||||
atomic_uint non_uniform_counter; // ERROR
|
||||
uint val = atomicCounter(counter);
|
||||
atomicCounterDecrement(counter);
|
||||
}
|
||||
|
||||
layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp
|
||||
Loading…
Add table
Add a link
Reference in a new issue