[Mesa-dev] [PATCH 1/7] mesa: implement glBindBuffersBase() and gl BindBuffersRange()

Fredrik Höglund fredrik at kde.org
Mon Jan 6 23:49:50 PST 2014


Maxence, while I think it's great that you're interested in working
on this extension, I'm afraid I have another implementation in
a branch in my mesa tree:

http://cgit.freedesktop.org/~fredrik/mesa/log/?h=arb-multi-bind

I've looked at your patches, and noticed you've implemented the
functions by calling the _mesa_Bind*() functions in a loop.  I know
that the specification uses examples that look very much like this
to illustrate the intended effect of calling each function.  But when
actually implemented in this this way you don't get the performance
benefit you would get by writing a specialized implementation of
each function.

For example you can avoid locking the mutex that protects the hash
table more than once when you look up the pointers to the objects.
There is also some state validation that doesn't need to be repeated
for each object.

Another downside is that when an error occurs, the _mesa_Bind*()
functions will report the wrong entry point in the error message.
The quality of those messages is important now that we support
KHR_debug, because they are reported to the client.

While your implementation is simpler than mine, I think my approach
is better in the long term. But I think others should chime in on this.

Fredrik



More information about the mesa-dev mailing list