0
\$\begingroup\$

Quick question for an opengl guru, I'm in the process of building a render queue and can either reduce the number of shader binding or the number of vertex buffer binding. I just want to know which one is more expensive on newer graphics cards (IE)(opengl >= 3.2)?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ How many shaders vs how many vertex buffers? \$\endgroup\$
    – House
    Commented Nov 22, 2012 at 23:36
  • 3
    \$\begingroup\$ Profile, benchmark, make an informed decision. \$\endgroup\$ Commented Nov 22, 2012 at 23:47
  • \$\begingroup\$ I asked a question somewhat similar/related to this on GameDev.net, which I think you may find interesting. It's not so much about binding buffers, but still relevant. \$\endgroup\$
    – Cornstalks
    Commented Nov 24, 2012 at 8:44

1 Answer 1

2
\$\begingroup\$

How exactly your system performs state changes is not part of the OpenGL specification, so perfomrances may vary betwen diffrent vendors and implementations. The only real way to answer your question is simply by testing it. Write a simple test program (or use the the thing you´re currently working on if possible), which performs alot of buffer bindings to reduce shader bindings and then the opposite. Use a high precision clock to measure the time of both test cases and compare.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .