Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Nested loop in GLSL causes driver crash.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 Aethanol   Members   

108
Like
0Likes
Like

Posted 08 June 2012 - 03:04 PM

Hello,

I'm trying to write an image fusion program in OpenGL/GLSL. At one point I need to calculate a cumulated histogram for a 7x7 pixel area. In fragment shader I'm trying to use a function:

float graythresh(float aArea[49])
{
float hist[256];
for(int i = 0; i < 49; i++)
  hist[(int)(aArea[i]*255)]+= 1.0;

for(int i = 0; i < 256; i++)
  hist[i] /= 49.0;

for(int i = 255; i >= 0; i--)
  for(int j = 255; j >= 0; j--)
	if(j > i)
	  hist[i] += hist[j];

return 0.0;
}

The last loop causes application crash and error "driver stopped responding". I tried using older drivers, and testing the application on different computer, nothing changed.

for(int i = 255; i >= 0; i--)
  for(int j = i-1; j >= 0; j--)
	hist[i] += hist[j];
Gave same error. Is it even possible to this?

Thanks in Advance, any help will be appreciated.

(I'm using GeForce GT 420M, windows 7)




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.