so, GLSL is pretty cool, but is there any way to determine what cards/chipsets any given program will run on? in a similar vein, if a given program will “mostly work” on a specific card, is there any way to determine which part won’t or will need to be rewritten to get it to work?
that is, your driver might support GLSL, but that doesn’t mean every valid program will run on your card (obviously). how to tell which ones won’t without actually having access to every card out there?
also, what happens if your program will work on a card, except for like 1 line that isn’t supported by the hardware. does the program compile but not work correctly, or does the compile itself fail?
the nice thing about Cg is since it compiles to profiles which correspond to actual extension strings, you can determine apriori whether a shader will work on a card by determining whether the necessary extension is supported. AND Cg will crap out if you try to compile something that won’t work on a given profile.
to expand on my question, the following vertex shader should (in theory) technically work on any hardware ever made, since it is not doing anything weird (even if that means using the default pipeline):
void main()
{
gl_Position = glModelviewProjectionMatrix *gl_Vertex;
}
but as the program becomes more complicated, it is hard to know what features you can or can’t use based on the capabilities of a given card or chipset.
obviously no card out there probably supports every single thing that the GLSL spec outlines, yet. but partial support is available. so how do you know what any card can/can’t do when writing a shader?
what would be nice is to have a way to submit a program to a card profile validator or something that would check if the things you are trying to do with a program are supported by any given card. like a database of features since GLSL can’t be broken down into a set of overlapping capabilities like the extensions can.