Sign in to follow this  
incin

GLSL driver crash

Recommended Posts

incin    205
I'm writing a fragment shader in GLSL. I'm pretty new to this, but have finally been having some luck getting stuff to work. But now I seem to have uncovered a bug with the driver or shader compiler. In essence, I'm doing this:

[code]

int myfunc(..., out vec3[4] myarray)
{

// do some crunching...
myarray[0]=vec3(1,0,0);
if (some_test)
{
// ___Uncommenting out this line causes the driver to crash___:
// myarray[0]=vec3(1,0,0);
}
return 0;
}[/code]



Leaving the line commented out, it runs just fine. Uncommenting it should make no difference. Anyway, the question is: How do I figure this out? Tools, debug modes, log files? I'm using a Radeon HD 6800 -- on what I believe are the latest drivers. Any ideas?

Share this post


Link to post
Share on other sites
incin    205
Update:
I checked the driver version, and it wasn't quite at the latest version. So I went to install the new version, and got a BSOD. After getting the driver reinstalled, the shader will run once again. Is it possible that my shader corrupted some memory? Also, if anyone has any ideas about how to best debug these things, that would be great.

Share this post


Link to post
Share on other sites
incin    205
Update (2):
I'm still getting crashes when I shouldn't. When I say crash, I mean that i get a black screen for a few seconds, and windows comes back and pops up a message saying the driver stopped responding and has recovered.
Now i'm wondering if I should have bought NVidia?

Share this post


Link to post
Share on other sites
incin    205
Update (3):
I believe i've tracked down the problem to using too much memory -- but I didn't expect the driver to crash. Essentially, I have an array:
vec3[30] abc;

If I change the array size to 3, it runs at FPS >1000. If I change to 20, the FPS drops to 500. If I go up to 30, it crashes. I've temporarily rigged the code so there's no difference in processing, it only uses the first array element.

Why does using slightly more memory have such an effect on the runtime? Is there a rule-of-thumb memory limit in fragment shaders? Any input is helpful, I'm a noob at this stuff.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this