Simple GL compute shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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