It is common knowledge that you should mask floating-point exceptions if you use OpenGL in your Win32 Delphi application.
In fact, the RTL more or less does this behind your back, because the OpenGL
unit has the following initialization section:
SetExceptionMask([exInvalidOp..exPrecision]);
(That set is the universe.)
In addition, the 2022 documentation for this function states
You typically need to mask and unmask exceptions when you are interacting with external code such as TWebBrowser, OLEDB, .NET assembly, ActiveX controls, and OpenGL.
However, I strongly suspect this text has been essentially the same for 20 years or more. Apparently the RTL documentation on Set8087CW
contained this already in early 1999:
For example, it is recommended that you disable all floating point exceptions when using OpenGL to render 3D graphics.
Today, this text has been rephrased slightly:
When using OpenGL to render 3D graphics, we recommend that you disable all floating-point exceptions for performance reasons.
Now, a lot has changed since the last millennium. When the 1999 text was written, people were using Windows 95, nVidia's GeForce had not been heard of yet, and everyone was using the fixed-function pipeline in OpenGL. Most programs probably sent a single vertex at a time to the driver! The fixed-function API was used for materials, lighting, fog, etc.
This is very far from modern OpenGL, where you write and compile your own GPU programs (shaders) and send large buffers to the video card's memory. The CPU isn't involved much at all.
So, my question is: Do you still need to mask floating-point exceptions in modern Win32 Delphi OpenGL applications?
Obviously, you may not want to change your application's floating-point handling just because you have added a few 3D features to it.
I have tried myself to re-enable floating point exceptions, and my modern Win32 Delphi OpenGL app seems to run just fine -- on my computer. But that doesn't prove that it is safe to do so. (Perhaps enabling these exceptions will make the app crash on 10% of all modern PCs?)
Unfortunately, I have not been able to find any authoritative and up-to-date information on this topic on the WWW. (It's almost like kids these days don't spend their free time writing OpenGL apps in Delphi.)
Related Q&As