Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Number of elements in VBO is a multiple of 4 => performance improvement

  1. #1
    Intern Contributor
    Join Date
    Sep 2013
    Posts
    70

    Number of elements in VBO is a multiple of 4 => performance improvement

    Hi,

    I was experiementing recently and I found out that the performance of my rendering improved when I had 4 texcoords instead of 2 and x, y, z, 1 instead of just x, y, z.
    My question is, is this just coincidence or maybe my own hardware that has this quirk, or is it a general rule of thumb, that you should always have multiples of 4 as vertex data?

    Thank you in advance.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,101
    Current gpu hardware is based on multiples of 4 floats. AFAIK the transfer from system memory to gpu memory is not. So it is possible that you see an improvement but you can also loose performance by transferring unnecessary data along the memory bus.
    As you will read time and again here, you have to do a lot of your own performance measurements because your individual data can determine the best options to choose.

    My rule of thumb is that I pack data into multiples of 4 whenever I can but I don't transfer empty data. So for example I will look to put something useful into vertex.w like colour specular.

  3. #3
    Intern Contributor
    Join Date
    Sep 2013
    Posts
    70
    Okay, thank you for the information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •