It's very convenient. For example:
layout(location = 0) in vec4 in_vertex;
That makes loading the file relatively simple, since you just run it through a function that spits out both vertex and fragment:
One string without the first define, and the second without the other. The rest of the files contents are still present in both files, but the shader compiler will compile only the relevant parts. Take care though if you are compiling shaders during rendering. In that case you will want to pay special attention to the length of the shader code.
The benefit of doing this, is reducing the number of files you need to keep track of, and in the webserver case, the files you need to transfer
The contents in both are related in that the vertex program sends data to the fragment program. The transferred data you use in the fragment shader must come from matching out statements on the vertex program.
I used to separate the files previously, and it was OK. I just got to the point where I had alot of shaders, and it helped abit to reduce number of files.
You do lose the ability to combine common vertex programs with specialized shaders, such as the generic fullscreen quad vertex shader.
Edited by Kaptein, 19 December 2013 - 01:22 PM.