Skip to content

Instantly share code, notes, and snippets.

@rygorous
Created January 4, 2016 18:04
Embed
What would you like to do?
Simple GL compute shader
#version 430 core
layout(local_size_x=8, local_size_y=8) in;
layout(binding=0) uniform writeonly uimage2D o_img;
layout(location=0) uniform uvec4 i_col;
void main()
{
ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
ivec2 rpos = pos.xy + ivec2(i_col.xy);
imageStore(o_img, pos, uvec4((rpos.x ^ rpos.y) & 255, 0, 0, 0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment