Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-11

Is GLUT_EXCLUSIVE_FPUMODE really needed?

3 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michalis Kamburelis

Hi,

This applies to GLUT_EXCLUSIVE_FPUMODE mode inside packages/opengl/src/glut.pp source code. Reading history, I see it was caused by this bug and patch:
http://bugs.freepascal.org/view.php?id=7570 . However, it's not needed anymore, IMHO. It seems submitter of #7570 hacked glut unit, suspecting the troubles inside GLUT, while in fact it is OpenGL library causing floating point trouble.

Moreover, since FPC 2.2.0, we have a correct fix inside the gl.pp unit itself (see #5914 and #7570). Inside gl.pp, we do SetExceptionMask to hide fpu errors that may be raised by some OpenGL implementations on all x86. This, in my view, makes the GLUT_EXCLUSIVE_FPUMODE not needed. The GLUT_EXCLUSIVE_FPUMODE duplicates the work (adds the same ExceptionMask flags) that is already done, in much simpler way, by gl.pp initialization.

Comments?

P.S. On an unrelated note, I'm preparing a patch to add freeglut extensions to glut unit. It's actually ready, but now I'm wondering if it's worth the trouble to deal with complications caused by GLUT_EXCLUSIVE_FPUMODE, when instead we could just remove the GLUT_EXCLUSIVE_FPUMODE hack :)

Michalis

Reply by email

Michalis Kamburelis

Ups, looks like I messed up bug numbers in my previous email.

This time correctly:

- The bugreport that caused the creation of GLUT_EXCLUSIVE_FPUMODE is here: http://bugs.freepascal.org/view.php?id=8995 . I basically propose to revert the changes caused by it to the GLUT unit (the whole {$ifdef GLUT_EXCLUSIVE_FPUMODE} part).

- The other bugreports, #5914 and #7570, are my old bugreports that talk about why fpu exception masking is needed at the very OpenGL unit (on X86). They caused the proper solution, that make the GLUT_EXCLUSIVE_FPUMODE obsolete IMHO.

Thanks,
Michalis

Reply by email