I know that I can get a lot of information about what my GPU can do (for eg. max texture size) but I cannot find information about shader units in specification.
How to obtain information “is such shader unit present in gpu”?
By that I mean: is geometry shader unit present (and in future, are hull, domain shader units present)?
I assume that from OGL 3.0 all gpu’s that support it need’s to have vertex and fragment units.
Ok but this is not the answer I am looking for. This all are workarounds, and I’m interested in direct testing of presence of some programmable stages in gpu pipeline.
Are there some states that describes it like for e.g.:
glGetIntegerv(GL_MAX_TEXTURE_SIZE,(GLint*)&support.maxTextureSize);
Or do I really need to check it by extensions presence ;/ ?
GL_MAX_TEXTURE_SIZE exists from beginning, but what about GL_MAX_TEXTURE_UNIT?
This token comes from extension: GL_EXT_multitexture
So before you even ask for GL_MAX_TEXTURE_UNIT with glGetInteger, you need to check if that extension is present. Otherwise the river may not understand the question and pop an error.
Of course you can interpret an error as “unsupported”, but wait! Isn’t THAT a workaround?
So let me put this straight: asking for extensions is not a workaround.
You may write some helper function like:
bool IsExtensionSupportec(const char * name);
Or you may use libraries like GLEW or GLEE. GLEW provides such functions.