Is there any built-in way to query if an extension is available inside a shader?
So you could do something like:
#if GL_EXT_gpu_shader4
#extension GL_EXT_gpu_shader4 : enable
#endif
Or is the only option for the application to query the extension and pass the information to the shader somehow?
Great, thanks!
I see now in the the spec for gpu_shader4 it says:
“A new preprocessor #define is added to the OpenGL Shading Language:
#define GL_EXT_gpu_shader4 1”
So this isn’t something that’s necessarily going to be the case for every extension? I couldn’t find any mention of it in the GLSL spec.
aqnuep
March 20, 2013, 2:23pm
4
Yes, all extensions have a preprocessor #define .
And yes, that’s not discussed in the GLSL spec as the GLSL spec discusses only core features (i.e. ones that are part of the core spec, thus they don’t have to be explicitly enabled).
system
Closed
October 19, 2021, 7:17pm
5
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.