PDA

View Full Version : why there is no double version of glUniform?



zzzhhh
06-08-2014, 06:12 AM
I checked the webpage http://www.opengl.org/wiki/GLAPI/glUniform but noticed that glUniform API seems not have double version, i.e., something like glUniform3d for dvec3 uniform variables. Does this API really not support double? If not, why?

carsten neumann
06-08-2014, 09:43 AM
It's available through an extension, see GL_ARB_gpu_shader_fp64 (http://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt). Hardware is only (somewhat) recently acquiring full support for double precision computations. Making double a first class citizen type in the spec would render all implementations that don't support it non-conforming - my guess is that was considered too strict a requirement.

zzzhhh
06-08-2014, 04:03 PM
Thanks a lot, carsten neumann. I'm so glad to see my GT640 card support GL_ARB_gpu_shader_fp64. Cool!

malexander
06-08-2014, 04:41 PM
Double-precision computation on many GPUs, especially consumer versions, is often much slower than single-precision, by anywhere from 2x - 24x slower. I believe the GT640 FP64 performance is 1/24th that of the FP32 performance. So you might want to use double precision sparingly, only if absolutely necessary.