Skip to content

Instantly share code, notes, and snippets.

@JuanDiegoMontoya
Last active April 11, 2024 22:38
Show Gist options
  • Save JuanDiegoMontoya/913585360b32f532b79a4bc893e0f655 to your computer and use it in GitHub Desktop.
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)
#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