# GLSL driver crash

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

## Recommended Posts

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:

 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; }

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 on other sites
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 on other sites
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 on other sites
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.