| | #version 310 es |
| |
|
| | layout(local_size_x = 2) in; |
| | layout(local_size_x = 16) in; |
| | layout(local_size_z = 4096) in; |
| | layout(local_size_x = 2) in; |
| | layout(local_size_y = 0) 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[]; |
| | int value; |
| | } invalid; |
| |
|
| | void main() |
| | { |
| | barrier(); |
| | memoryBarrier(); |
| | memoryBarrierAtomicCounter(); |
| | memoryBarrierBuffer(); |
| | memoryBarrierShared(); |
| | memoryBarrierImage(); |
| | groupMemoryBarrier(); |
| | value = int(values[gl_LocalInvocationIndex]); |
| | } |
| |
|
| | layout(location = 2) in vec3 v3; |
| | in float f; |
| | out float fo; |
| |
|
| | shared vec4 s; |
| | layout(location = 2) shared vec4 sl; |
| | shared float fs = 4.2; |
| |
|
| | layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; |
| |
|
| | 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; |
| | ro.values.length(); |
| | ++s; |
| | } |
| |
|
| | buffer vec4 v; |
| |
|
| | uniform usampler2D us2dbad; |
| |
|
| | precision highp usampler2D; |
| | precision highp iimage2DArray; |
| | precision highp iimage2D; |
| |
|
| | uniform usampler2D us2d; |
| |
|
| | uniform iimage2DArray ii2dabad; |
| | uniform writeonly iimage2DArray ii2da; |
| |
|
| | layout(r32i) uniform iimage2D iimg2D; |
| | layout(rgba32i) uniform readonly iimage2D iimg2Drgba; |
| | layout(rgba32f) uniform readonly image2D img2Drgba; |
| | layout(r32ui) uniform uimage2D uimg2D; |
| |
|
| | void qux() |
| | { |
| | int i = 4; |
| | imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i); |
| | imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); |
| | imageAtomicMin(iimg2Drgba, ivec2(i,i), i); |
| | imageAtomicMax(img2Drgba, ivec2(i,i), i); |
| | 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)); |
| | } |
| |
|
| | volatile float vol; |
| | readonly int vol2; |
| |
|
| | 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); |
| | passr(iimg2D); |
| | } |
| |
|
| | highp layout(rg8i) uniform readonly uimage2D i1bad; |
| | highp layout(rgba32i) uniform readonly image2D i2bad; |
| | highp layout(rgba32f) uniform readonly uimage2D i3bad; |
| | layout(r8_snorm) uniform readonly iimage2D i4bad; |
| | layout(rgba32ui) uniform readonly iimage2D i5bad; |
| | layout(r8ui) uniform readonly iimage2D i6bad; |
| |
|
| | layout(binding = 0) uniform atomic_uint counter; |
| |
|
| | uint func(atomic_uint c) |
| | { |
| | return atomicCounterIncrement(c); |
| | } |
| |
|
| | uint func2(out atomic_uint c) |
| | { |
| | return counter; |
| | return atomicCounter(counter); |
| | } |
| |
|
| | void mainAC() |
| | { |
| | atomic_uint non_uniform_counter; |
| | uint val = atomicCounter(counter); |
| | atomicCounterDecrement(counter); |
| | } |
| |
|
| | layout(binding = 1) uniform mediump atomic_uint counterBad; |
| |
|
| | layout(binding = 2, offset = 4) uniform atomic_uint countArr[4]; |
| | uniform int i; |
| |
|
| | void opac() |
| | { |
| | int a[3]; |
| | a[counter]; |
| | countArr[2]; |
| | countArr[i]; |
| | } |
| |
|
| | shared int atomi; |
| | shared uint atomu; |
| |
|
| | void atoms() |
| | { |
| | int origi = atomicAdd(atomi, 3); |
| | uint origu = atomicAnd(atomu, 7u); |
| | origi = atomicExchange(atomi, 4); |
| | origu = atomicCompSwap(atomu, 10u, 8u); |
| | } |
| |
|
| | precision highp atomic_uint; |
| | precision lowp atomic_uint; |
| |
|
| | precise int pfoo; |
| |
|
| | dmat2x4 dm; |
| | uniform samplerCubeArray sca; |
| | uniform iimage2DRect i2dr; |
| | highp uniform image2DMS i2dms; |
| | uniform uimage2DMSArray u2dmsa; |
| |
|
| | highp layout(r32f) coherent volatile restrict readonly writeonly uniform image2D okay1; |
| | layout(r32i) coherent volatile restrict readonly uniform iimage2D okay2; |
| | highp layout(r32ui) coherent volatile restrict writeonly uniform uimage2D okay3; |
| | highp layout(r32f) coherent volatile restrict uniform image2D okay4; |
| | |
| | highp layout(rgba32f) coherent volatile restrict uniform image2D badQ1; |
| | layout(rgba8i) coherent volatile restrict uniform iimage2D badQ2; |
| | highp layout(rgba16ui) coherent volatile restrict uniform uimage2D badQ3; |
| |
|
| | writeonly buffer woblock |
| | { |
| | int value; |
| | float values[]; |
| | } wo; |
| |
|
| | void foowo() |
| | { |
| | float g; |
| | g = wo.values[2]; |
| | float f = wo.values[2]; |
| | ++wo.values[2]; |
| | wo.values[2]--; |
| | f + wo.values[2]; |
| | wo.values[2] - f; |
| | bool b; |
| | b ? f : wo.values[2]; |
| | b ? wo.values[2] : f; |
| | if (f == wo.values[2]) |
| | ++f; |
| | if (f >= wo.values[2]) |
| | ++f; |
| | f = vec3(wo.values[2]).x; |
| | ~wo.value; |
| | wo.values[2] = 3.4; |
| | } |
| |
|
| | buffer multioblock |
| | { |
| | readonly int value; |
| | writeonly float values[]; |
| | } multio; |
| |
|
| | void foomultio() |
| | { |
| | float g; |
| | g = wo.values[2]; |
| | ~wo.value; |
| | wo.values[2] = 3.4; |
| | wo.value = 2; |
| | } |
| |
|
| | in inb { |
| | int a; |
| | } inbi; |
| |
|
| | out outb { |
| | int a; |
| | } outbi; |
| |
|
| | float t__; |
| |
|
| | |
| | #define __D |
| |
|
| | shared vec4 arr[2][3][4]; |
| |
|
| | void devi() |
| | { |
| | gl_DeviceIndex; |
| | gl_ViewIndex; |
| | } |
| |
|
| | #ifdef GL_EXT_device_group |
| | #extension GL_EXT_device_group : enable |
| | #endif |
| |
|
| | void devie() |
| | { |
| | gl_DeviceIndex; |
| | gl_ViewIndex; |
| | } |
| |
|