Original Post
🔒 Locked
getShaderVersion() ???
Advertisement
In Cg there is a function called something like cgGLGetNewestProfile(CG_VERTEX_PROG) or something like that.
Quote:
Original post by RichardS
There are no such versions. If the GLSL extensions string is exported, you can use GLSL. Just be sure to check the HW limits using the functions provided in ARB_vertex_shader and ARB_fragment_shader.
ok. thanks :)
what do you mean by checking the functions? You mean I should check if the shader compiles and links?
The problem is that I have shaders which should use dynamic branching and loops if the HW supports them. Otherwise It should use "light-versions" of the shaders. But the decision should be made in the c++ program.
Maybe there is a workaround for this?
You can call glGetString(GL_SHADING_LANGUAGE_VERSION_ARB) but it's not very useful for what you wanted (figuring out capabilities). its not a standardised format. Mine looks like this: "1.10 NVIDIA via Cg 1.3 compiler".
Cant you just make some small shader programs that test the capabilities. for example, texture reads from vertex shader, dynamic branching in fragment shader etc and see if it compiles? Compiling a small program like that should be fairly quick.
Edit: by "not standardized format" I meant that there was more than a number there, I havent checked the glsl spec on this so it is possible that all version strings must have the actual number first... anyway it wont help with what you were after.
you can also query some language features. GL_MAX_VERTEX_ATTRIBS_ARB, GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB etc. google for the rest
Cant you just make some small shader programs that test the capabilities. for example, texture reads from vertex shader, dynamic branching in fragment shader etc and see if it compiles? Compiling a small program like that should be fairly quick.
Edit: by "not standardized format" I meant that there was more than a number there, I havent checked the glsl spec on this so it is possible that all version strings must have the actual number first... anyway it wont help with what you were after.
you can also query some language features. GL_MAX_VERTEX_ATTRIBS_ARB, GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB etc. google for the rest
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement