Just a clarification. Im not trying to do anything - this is a theoretical problem only as i think every vendor out there supports compatibility profile in GLSL.
Pretty much, set up compatibility profile GLSL shader that will compile (assuming no compiler bugs).
You cant be sure that following will compile (assuming version string advertises 330 for GLSL):
#version 330 compatibility
void main() {}
As compatibility profile is optional. There should be a way to check if its supported. My point it, its stupidly complicated to confirm that support ‘the right way’.
Granted one could just compile away and be done with it, but this just doesn’t seem right.
[quote]These macros are, however, pretty much useless.
They do exactly what they’re supposed to: allow you to conditionally compile code based on whether the profile is core or compatibility.
[/QUOTE]
I don’t think this is what they do. These macros are unaffected by current shader profile you are compiling with - they just expose GLSL shader compiler capabilities (at least this is how i read their specification).
Implementations providing the compatibility profile provide the following macro:
#define GL_compatibility_profile 1
There is no mention that this macro appears only in compatibility profile.
If what you suggest is true, then there is no way to discover support for compatibility profile, except failing compilation of shader i provided above.
Your main shader file should have no version declaration. Instead, the C/C++ code that loads the shader into the shader object will apply a version string as the first string, while the shader’s body will be the second string. It’s really quite simple.
This is all cool, but still, how would you check for ‘compatibility’ profile availability so you can push it to your version string?
My whole point is that you cant (at least in a reasonable way).