Last active
April 11, 2024 22:38
-
-
Save JuanDiegoMontoya/913585360b32f532b79a4bc893e0f655 to your computer and use it in GitHub Desktop.
UPDATE: This does not actually work in its current form! Use nonuniformEXT on available drivers (AMD at the time of writing). GLSL cross-platform non-uniform resource indexing hack (I did not make this)
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
#extension GL_ARB_shader_ballot : require | |
uint NonUniform(uint i) | |
{ | |
for (;;) | |
{ | |
uint cur = readFirstInvocationARB(i); | |
if (cur == i) | |
{ | |
return cur; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment