Ian Romanick wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I've just posted a patch that implements GL_APPLE_vertex_array_object at: > > http://users.freedesktop.org/~idr/patches/ > > The patch, which is quite large anyway, does *NOT* include changes to > any generated files. To test this patch you'll need to regenerate > src/mesa/main/get.c and do a make in src/mesa/glapi. > > The patch is pretty straight forward, and no attempts are made at doing > optimal object switching. Ideally a driver would want to store some > additional state with the array object and hook BindArrayObject. The > driver would then use the state stored in the object to quickly restore > the old array state. > > I'm also not convinced that this patch handles PushAttrib / PopAttrib > correctly. Although, most parts of OpenGL are pretty busted when you > push an object, delete it, then pop it. In this particular case, the > pop will restore a pointer to freed memory. > > The text describing the behavior in the extension spec is a bit > squirlely. It almost sounds like the push has to save the bind and all > of the individual attribute values. The pop the repeats the binding > (which may re-create the deleted object) and resets the values. That's > pretty different from the way texture objects work (e.g., popping a > texture object doesn't redo the bind then reset the filter mode). > > I'll try to do some testing on OS X so that we can replicate its > behavior. Since that is the only other known implementation of this > extension, whatever it does is by definition correct. :) > > There is also a simple demo program for this extension called > progs/demos/vao_demo.c. > > Before people start asking, I implemented this extension for two main > reasons. First, it came up as part of the work I did for my DDC paper. > Second, some form of array state container objects are almost certain > to come up in one of the next core versions of OpenGL. By doing an > implementation of it, I can see what some of the issues are.
This looks pretty good. Much of the patch just replaces "ctx->Array." with "ctx->Array.ArrayObj->". Go ahead and check this in if you want. Unfortunately, I recently made some small changes to bufferobj.c that will probably cause the patch to fail for that file. Other minor things: 1. You may want to add a lookup_arrayobj() function like I've implemented in other places to wrap the _mesa_HashLookup() and casting. It makes things a big neater. 2. Perhaps rename 'NullArrayObj' to 'DefaultArrayObj'. I used "Null" in bufferobj.c since there isn't a user-visible buffer object named zero. But I use "Default" for texture objects and vertex/fragment programs since there is a 0th object of those types. 3. It looks like there's a little left-over buffer-object cut&paste language in arrayobj.c (s/buffer/array/ basically) I can take a closer look at the Push/PopAttrib details someday. -Brian _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
