Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generic programming in GLSL (parametric polymorphism, template metaprogramming)
//I wish there were a better way to do this!
#define generic_add(type) type add(type a, type b){ return a + b; }
generic_add(int)
generic_add(float)
generic_add(vec3)
generic_add(bool)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment