LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Daslee on September 02, 2014, 15:04:14

Title: Error loading tessellation shaders
Post by: Daslee on September 02, 2014, 15:04:14
Hello. I have a quick question. Why do I get this error:

Quote(0) : error C0000: syntax error, unexpected $end at token "<EOF>"

while loading tessellation shader? While loading vertex/geometry/fragment shaders I do not get this error, even all of the shaders are loading in the same way..
Title: Re: Error loading tessellation shaders
Post by: quew8 on September 02, 2014, 18:10:59
I expect because the parser reached the end of the file when it was expecting something else. Check you've paired all your braces and brackets and that you haven't missed something.
Title: Re: Error loading tessellation shaders
Post by: Daslee on September 02, 2014, 18:42:35
I don't think that my code is wrong. For example, here is tessellation control shader source (and this one is also throwing EOF error):

layout(vertices = 4) out;

uniform int NumSegments;
uniform int NumStripes;

void main()
{
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
gl_TessLevelOuter[0] = float(NumStripes);
gl_TessLevelOuter[1] = float(NumSegments);
}
Title: Re: Error loading tessellation shaders
Post by: Cornix on September 02, 2014, 19:46:17
Have you tried putting a newline at the end? I know this sounds stupid, but some parsers want it this way.
Title: Re: Error loading tessellation shaders
Post by: Daslee on September 02, 2014, 19:52:18
Quote from: Cornix on September 02, 2014, 19:46:17
Have you tried putting a newline at the end? I know this sounds stupid, but some parsers want it this way.

I can't test it now, because I'm on windows now (programming only on linux), tomorrow I'll try it. But I don't think so, that this is the problem, because why vertex/geometry/fragment shaders are compiling successfully without newline at the end?  :-\
Title: Re: Error loading tessellation shaders
Post by: quew8 on September 03, 2014, 08:46:06
There are occasionally driver bugs with this sort of thing. Try searching the error in Google along with your card manufacturer's name / video card name.