Search code examples
glsl

Video cards and hardware-accelerated operations on double


Good day to all!

I am trying to use computational shaders (GLSL) to speed up some geodetic calculations. I recently got an experience showing that FP32 (float) accuracy is not enough. In trying to enable (with special commands) "double mode", I learned that consumer gaming video cards, mostly, but not always (examples?), do not have hardware acceleration of operations on FP64 - the compiler just shows an error.I found out that professional video cards are just designed for such cases.

Please tell me how it works? I just insert some NVidia Quadro or Radeon PRO into the computer, install the appropriate drivers, and I can safely compile the same program with operations on FP64, and the compiler will not show errors, right?


Solution

  • I learned that consumer gaming video cards, mostly, but not always (examples?), do not have hardware acceleration of operations on FP64

    I would advise you to cease listening to whatever source you "learned" this from. It was either over a decade out-of-date (double-precision has been a required feature since OpenGL 4.0) or it is far too unreliable to bother with.

    Now, there is always a difference between supported and well supported. Basically every desktop GPU made within the last 10 years can do double-precision math in shaders. But it is usually at a substantial performance penalty. It is "hardware accelerated", but it generally won't be at the same speed as 32-bit floats.

    But ultimately, its best to just test it and see if it suits your needs.