Jump to content
  • Advertisement
Sign in to follow this  
include4eto

Strange GLSL bug

This topic is 2563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Completely guessing - but it could have something to do with the fact that the while loop is unbounded (could be infinite).

Share this post


Link to post
Share on other sites
Can't be that, the COMPILER crashes, it never even executes it.
Does it crash, or fail to link the shader, causing your program to crash? If the driver crashes, how do you get the error from it? [edit]Oh, does OpenTK throw an exception when you try to compile the shader? Does the exception contain any information from the driver's compiler about why it failed?

The compiler may be attempting to determine an upper-bound on the loop, and when it can't, it may return failure, which maybe OpenTK is translating into an exception for you.

Also, is this OpenGL or GLES, and which version of GLSL are you using?

Share this post


Link to post
Share on other sites
either this is not the real error(somehting what happens before, or it is a driver error(did u upgrade your video drivers latly?)

to find out, test your code on another machiene and if it fails their also try to simplify your hole programm until u know what causes the bug.

Share this post


Link to post
Share on other sites
can u rewrite your shader a little bit, so it will do the same thing but perhaps with other kind of loops or so?

If I remember correct there was a case that a compiler wouldn't comple a for loop if it had to many possible iterations, perhaps with your video card/driver the same is happining, could u post your hole shader code?

Share this post


Link to post
Share on other sites
The problem is definately in that while() loop; I gave this a quick go (compiling on my Nvidia card) and the linker failed. I realize that the code you've given here is a simplified version, but I can't understand the fragment shader at all; as Hodgman said the while() loop could be infinite, and perhaps that's what's troubling the compiler.

Also (although this won't be what's causing the problem), 'varying' and 'ftransform' are deprecated, you need to specify that you're using the compatibillity profile or that your shaders are adhering to an older GLSL spec. Maybe you're doing this and just haven't included it in the example code.

Anyway, I'd second Danny02 and say that you should factor out that while() loop.

Share this post


Link to post
Share on other sites
I've seen similar errors on Nvidia cards before:

1. Try updating your drivers.
2. Make sure your shader is only using characters that can be represented by ASCII. This is a GLSL limitation and shaders *will* fail mysteriously if you use other character sets, either in comments or in actual code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!