On Monday, December 01, 2014 08:23:32 PM Neil Roberts wrote: > When submitting the vertex buffers the i965 driver will try to recognise when > multiple attributes are using the same buffer so that it can submit a single > relocation for it and set a different offset in the attribute. Previously > however if the application happens to have the attributes in a struct with an > order that doesn't match the order they are listed in the gl_vert_attrib enum > then the loop would end up processing the attributes with a greater offset > first and the optimisation wouldn't be used. > > To make the optmisation more likely to be used this patch makes it always > process the elements in increasing order of offset. This is done copying the > element pointers into a separate array and sorting it with qsort. This only > affects the order that the elements are processed and doesn't change the order > that they are submitted to the hardware. > --- > > I noticed this problem by inspection but I don't have a good feel for > how important avoiding the buffer relocations is so I don't know > whether the patch makes much sense. However I think the added overhead > to sort the attributes is minimal so I don't think it can do much > harm.
My suspicion is that avoiding the couple of extra relocations shouldn't really matter that much, and it may even be worth just deleting the existing "optimization." I'm definitely skeptical of adding /more/ code, since this is pretty much the hottest path in the driver. But I'd definitely be interested in any performance data you find. --Ken
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev