On 02.03.2010 11:37, Keith Whitwell wrote: > On Mon, 2010-03-01 at 10:02 -0800, Roland Scheidegger wrote: >> Hi, >> >> this branch turns vertex element into a cso, so instead of >> set_vertex_elements there's now the triad of >> create/bind/delete_vertex_elements_state. I have converted all the >> drivers except nouveau (I didn't do it because Christoph Bumiller >> already did nv50, but I can give the rest of them a shot), though that >> doesn't necessarily mean they are optimized for it (the idea is of >> course to precalculate state on create, not just copy the pipe structs >> and do everything on bind) - only i965g really does something close to >> it (though still emits the state always). Drivers doing both hw vertex >> shaders and using draw in some circumstances of course will have to >> store both representations on create. >> Also note that util_draw_vertex_buffer semantics have changed a bit >> (caller needs to set vertex element state, which is a bit odd). > > Roland, > > The branch looks good to me, happy to see it merged when you're ready to > go.
There's actually something in the cso code I was a bit unsure about, I've looked at it again and indeed it seems wrong. The problem is that the count value itself isn't stored for the comparison. So in the unlikely case the hash value is the same for pipe_vertex_elements with different counts, the comparison itself will also be the same as long as the first few elements are identical. Which seems very wrong. The easiest way to fix would probably be to just store the count alongside the pipe_vertex_element data, but that would need an additional copy of the incoming data in cso_set_vertex_elements. Hmm... Roland ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev