File: 420.comp

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (30 lines) | stat: -rw-r--r-- 932 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#version 420

layout(local_size_x = 2) in;  // ERROR, no compute

#extension GL_ARB_compute_shader : enable

layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in;

shared vec3 sfoo;

void main()
{
    sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z);
    sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID;
    sfoo *= gl_LocalInvocationIndex;
    sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize;
    sfoo *= gl_MaxComputeUniformComponents +
            gl_MaxComputeTextureImageUnits +
            gl_MaxComputeImageUniforms +
            gl_MaxComputeAtomicCounters +
            gl_MaxComputeAtomicCounterBuffers;

    barrier();
    memoryBarrier();
    memoryBarrierAtomicCounter();
    memoryBarrierBuffer();
    memoryBarrierImage();
    memoryBarrierShared();
    groupMemoryBarrier();
}