28 layout(local_size_x = 32) in;
41 layout(binding = 2, std430) writeonly
buffer BlockSumData
54 uvec4 miniblock0 =
buf[4u * ident + 0u];
55 uvec4 miniblock1 =
buf[4u * ident + 1u];
56 uvec4 miniblock2 =
buf[4u * ident + 2u];
57 uvec4 miniblock3 =
buf[4u * ident + 3u];
58 miniblock1 += miniblock0;
59 miniblock2 += miniblock1;
60 miniblock3 += miniblock2;
66 sharedData[local_ident] = miniblock3;
67 memoryBarrierShared();
73 for (uint step = 0u; step <
NUM_STEPS; step++) {
76 if ((local_ident & (1u << step)) != 0u) {
78 uint prev = ((local_ident >> step) << step) - 1u;
81 uvec4 sum_prev = sharedData[prev];
82 miniblock0 += sum_prev;
83 miniblock1 += sum_prev;
84 miniblock2 += sum_prev;
85 miniblock3 += sum_prev;
88 sharedData[local_ident] = miniblock3;
90 memoryBarrierShared();
95 if ((local_ident & (1u << NUM_STEPS)) != 0u) {
97 uint prev = ((local_ident >>
NUM_STEPS) << NUM_STEPS) - 1u;
100 uvec4 sum_prev = sharedData[prev];
101 miniblock0 += sum_prev;
102 miniblock1 += sum_prev;
103 miniblock2 += sum_prev;
104 miniblock3 += sum_prev;
108 outbuf[4u * ident + 0u] = miniblock0;
109 outbuf[4u * ident + 1u] = miniblock1;
110 outbuf[4u * ident + 2u] = miniblock2;
111 outbuf[4u * ident + 3u] = miniblock3;
114 if (local_ident == (gl_WorkGroupSize.x - 1u))
115 blocksum[gl_WorkGroupID.x] = miniblock3;
layout(local_size_x=32) in
shared uvec4 sharedData[gl_WorkGroupSize.x]
GLint GLint GLint GLint GLint x
GLenum GLuint GLenum GLsizei const GLchar * buf