diff options
Diffstat (limited to 'Master/texmf-dist/asymptote/shaders/sum2.glsl')
-rwxr-xr-x | Master/texmf-dist/asymptote/shaders/sum2.glsl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Master/texmf-dist/asymptote/shaders/sum2.glsl b/Master/texmf-dist/asymptote/shaders/sum2.glsl new file mode 100755 index 00000000000..1ab03513ebd --- /dev/null +++ b/Master/texmf-dist/asymptote/shaders/sum2.glsl @@ -0,0 +1,24 @@ +layout(local_size_x=LOCAL_SIZE_X) in; + +uniform uint offset2; + +layout(binding=2, std430) buffer localSumBuffer +{ + uint localSum[]; +}; + +void main(void) +{ + uint id=gl_GlobalInvocationID.x; + + uint row=LOCAL_SIZE_X*id; + uint stop=row+LOCAL_SIZE_X; + + uint Sum=localSum[row]; + for(uint i=row+1u; i < stop; ++i) { + Sum += localSum[i]; + localSum[i]=Sum; + } + + localSum[offset2+id+1u]=Sum; +} |