Results 1 to 4 of 4

Thread: why there is no double version of glUniform?

  1. #1
    Member Newbie
    Join Date
    May 2014
    Posts
    46

    why there is no double version of glUniform?

    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?

  2. #2
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896
    It's available through an extension, see GL_ARB_gpu_shader_fp64. 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.

  3. #3
    Member Newbie
    Join Date
    May 2014
    Posts
    46
    Thanks a lot, carsten neumann. I'm so glad to see my GT640 card support GL_ARB_gpu_shader_fp64. Cool!

  4. #4
    Senior Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    369
    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.

Similar Threads

  1. About the usage of glUniform{2|3|4}iv.
    By newbiecow in forum OpenGL: GLSL
    Replies: 2
    Last Post: 01-22-2013, 11:19 PM
  2. glUniform...what is it really doing?
    By jmXGL in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 01-22-2012, 02:27 AM
  3. glUniform + VBO bug?
    By _x57_ in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 08-24-2011, 09:08 AM
  4. Performance hit & glUniform
    By zerothrillz in forum OpenGL: GLSL
    Replies: 9
    Last Post: 06-10-2010, 06:09 PM
  5. glUniform of arrays
    By ugluk in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 11-30-2009, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean