Neil Roberts <[email protected]> writes:

> 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 would expect the sorting to cost more than the potential win you're
looking for.  Performance patches should come with performance data.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to