Sign in to follow this  
V-man

Division by zero and AMD

Recommended Posts

We have a project written in VB6. It uses GL 1.1. It runs fine on multiple Windows versions and different cards.

But with the Catalyst 13.1 driver and also previous one, "division by zero" message is getting thrown.

 

It happens on HD 5450, Win 7 32 bit and also on another HD series card.

It happens on simple functions like glScalef and glScissor.

The values being submitted to those functions are fine so I don't understand what the problem is. There is some behind the scene thing happening in the AMD drivers.

Share this post


Link to post
Share on other sites
If you know two special driver versions are not working then you just use some other driver version? Or if you have too much spare time you can rewrite your program to use a modern OpenGL version without those deprecated functions. Edited by wintertime

Share this post


Link to post
Share on other sites

Back in the days when I was using Borland compilers, there used to be this weird issue that OpenGL would occasionally throw floating point division by zero exceptions and you had to manually disable FP-exceptions. I believe that those were from the software vertex transformation which should reside in the GPU for most cards these days, but who knows.

I am using gcc now, where FP-exceptions are disabled by default, so I don't know if all of this is still an issue.

 

Can you check if your exception is a FP or integer exception and if FP-exceptions are enabled in your build?

 

std::cout << 1.0f/0.0f << std::endl;
E.g. should return "inf" and not throw an exception.

Share this post


Link to post
Share on other sites

wintertime : the driver that comes on the CD for the video card works fine. Rewriting the entire code would be too drastic and it also doesn't mean that it would solve the problem.

 

Ohforf sake : yes, I remember reading about that, back in 2000 or 2001. But in my case, is the AMD driver enabling exception? I don't know how to check if it is integer or floating point exception in VB6.

Share this post


Link to post
Share on other sites

A SOLUTION IS FOUND.

In VB6, go to project properties, click on compile tab.

Press the Advanced Optimizations button.

Click on Remove floating point exceptions check.



I had already done this in my project but for some reason, my partner's VB6 did not have that checked.

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