glMultiDrawArrays

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

glMultiDrawArrays

Jeffg
I don't understand what I'm suppose to put as the Intbuffer or Int[]
glMultiDrawArrays(int mode, int[] first, int first_offset, int[] count, int count_offset, int primcount)
glMultiDrawArrays(int mode, IntBuffer first, IntBuffer count, int primcount)

I understand the other pieces from DrawArrays, and I get the primcount.  What is first and count looking for here?  Can someone give an short example?
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDrawArrays

gouessej
Administrator
Hi!

I don't advise you to use glMultiDrawArrays because some implementations are buggy, lots of them only perform a loop and it rarely gives any performance boost:

The effect of glMultiDrawArrays() is the same as

for (i = 0; i < primcount; i++) {
   if (count[i] > 0)
      glDrawArrays(mode, first[i], count[i]);
}
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDrawArrays

Jeffg
Does that diminish the performance?
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDrawArrays

gouessej
Administrator
No it is not worse than using glDrawArrays but it may cause crash with some bad drivers, that is why I don't advise you to use it, I removed any call of this method from the source code of my first person shooter.
Julien Gouesse | Personal blog | Website