Created
June 22, 2018 02:40
-
-
Save jqly/b6dd03511f3563da3cc634c9583e0e83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
glCreateTextures(GL_TEXTURE_2D, 1, &headptr_tex_); | |
glTextureStorage2D(headptr_tex_, 1, GL_R32UI, window_width, window_height); | |
glBindImageTexture(0, headptr_tex_, 0, GL_FALSE, 0, GL_READ_WRITE, GL_R32UI); | |
// glsl | |
layout(binding=0, r32ui) uniform uimage2D headptrs; | |
... | |
for (uint kthnode = imageLoad(headptrs, ivec2(gl_FragCoord.xy)).r; | |
kthnode != 0xffffffff; | |
kthnode = nodes[kthnode]) { | |
frags[num_frags++] = nodes[kthnode]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment