Skip to content

Instantly share code, notes, and snippets.

@tobspr
Created June 27, 2014 13:56
Show Gist options
  • Save tobspr/bf1f31430ded9419ffaa to your computer and use it in GitHub Desktop.
Save tobspr/bf1f31430ded9419ffaa to your computer and use it in GitHub Desktop.
#version 430
layout (rgba8) uniform image2D destTex;
layout (local_size_x = 32, local_size_y = 32) in;
void main() {
vec4 result = vec4(0, 0, 0, 1);
int abc = 0;
for (int i = 0; i < 2000; i ++) {
abc += i;
}
result.x = float(abc) / 200000.0;
ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
imageStore(destTex, storePos, result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment