mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-24 03:39:51 +00:00
7d65f09b83
Enable below features for GL Core version 420: * layout qualifier "std430" * storage qualifier "buffer" * atomic memory functions
43 lines
1.1 KiB
GLSL
43 lines
1.1 KiB
GLSL
#version 420 core
|
|
|
|
layout(depth_any) out float gl_FragDepth;
|
|
layout(depth_greater) out float gl_FragDepth; // ERROR: redeclaration with different qualifier
|
|
|
|
void main()
|
|
{
|
|
gl_FragDepth = 0.3;
|
|
}
|
|
|
|
layout(depth_less) in float depth; // ERROR: depth_less only applies to gl_FragDepth
|
|
layout(depth_any) out float gl_FragDepth; // ERROR, done after use
|
|
|
|
layout(binding=0) uniform atomic_uint a[];
|
|
|
|
uniform writeonly image2D i2D;
|
|
ivec2 iv2dim = imageSize(i2D); // ERROR: imageSize called without enabling GL_ARB_shader_image_size extension
|
|
#extension GL_ARB_shader_image_size : enable
|
|
ivec2 iv2dim1 = imageSize(i2D);
|
|
|
|
#extension GL_ARB_shader_storage_buffer_object : enable
|
|
|
|
layout(binding = 0,std430) buffer Buffer
|
|
{
|
|
int atomi;
|
|
uint atomu;
|
|
};
|
|
|
|
void atomicOpPass()
|
|
{
|
|
int origi = atomicAdd(atomi, 3);
|
|
uint origu = atomicAnd(atomu, 7u);
|
|
origi = atomicExchange(atomi, 4);
|
|
origu = atomicCompSwap(atomu, 10u, 8u);
|
|
}
|
|
|
|
#extension GL_ARB_shader_storage_buffer_object : disable
|
|
|
|
layout(binding = 1,std430) buffer BufferFail // Error std430 and "buffer" block support disabled
|
|
{
|
|
int atom1i;
|
|
};
|