I want to create a unified shader file similar to the D3D FX format where vertex and fragment shaders are in one file. I have some technique annotations that I parse manually and I create a main function on the fly. I just send the complete shader code to the GLSL compiler, either as vertex or fragment shader. For a fragment shader, the vertex shader functions are just stripped out by the compiler since they are not called from my entry function. But I also have vertex attributes in this file of course.
Can I safely assume that the fragment shader parser will just ignore them without outputting errors? A quick look at the spec did not give me any info about that. It seems to work on NVidia drivers but I want to make sure that I don’t do anything “illegal” that could not work on other platforms/drivers.
Thanks in advance…