aik6980's picture

GLSL syntax question? vertex shader

both of the following GLSL VS is compiled fine during the compilation process,
but the second one failed the linking step.
I cannot see any major different in these, any idea where the error come from

1.

void main( void )
{
   gl_Position = matViewProjection * vec4(a_Vertex.xyz, 1.0);
}

2.

void main( void )
{
   vec4 posH = matViewProjection * vec4(a_Vertex.xyz, 1.0);
   gl_Position = posH;
}

here is an error
OpenGL ES Preview Window: Linking program .. failure
Vertex info
-----------
(0) : fatal error C9999: *** exception during compilation ***

Tested on OpenTK, RenderMonkey - both produce the same error

thanks in advance


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

"Exception during compilation" sounds like a driver bug. A wild shot: try specifying "precision" modifiers explicitly in the vertex and fragment shader.

aik6980's picture

thanks for the trick "explicitly declare precision".
trying that, it is working :( but randomly working. about two out of three, the Linker still still give me C999 error

Tested on RenderMonkey 1.8.2

Any other idea?

aik6980's picture

update my experiment,
Running on OpenTK, Compiled by VS2008

(0) : fatal error C9999: *** exception during compilation ***
the error is stated all the time on the "Debug" mode build,

most of the time, the program is working fine on the Release build ?

Now I'm a bit wonder about this C9999 error, is that vital ? it does look very random to me :(

the Fiddler's picture

This definitely sounds like a driver bug. Are you using the latest drivers for your video card? Try upgrading if not.

If the application works in release mode, you could simply ignore the error, especially if you cannot reproduce it on a different machine.