[Mesa-dev] [PATCH] i965: enable ARB_instanced_arrays extension

Eric Anholt eric at anholt.net
Tue Jun 12 17:55:44 CEST 2012


On Fri, 8 Jun 2012 14:16:47 -0700, Jordan Justen <jljusten at gmail.com> wrote:
> On Mon, Jun 4, 2012 at 1:31 PM, Eric Anholt <eric at anholt.net> wrote:
> > On Sun, 27 May 2012 21:08:07 -0700, Jordan Justen <jordan.l.justen at intel.com> wrote:
> >> Set the step_rate value when drawing to implement
> >> ARB_instanced_arrays for gen >= 4.
> >
> >> @@ -504,7 +513,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
> >>
> >>        nr_uploads = 0;
> >>        }
> >> -      else if (total_size < 2048) {
> >> +      else if (can_merge_uploads) {
> >>        /* Upload non-interleaved arrays into a single interleaved array */
> >>        struct brw_vertex_buffer *buffer;
> >>        int count = MAX2(max_index - min_index + 1, 1);
> >
> > The total_size < 2048 check probably should stay down here rather than
> > get moved inside the loop up above.  Other than that,
> 
> I think the code should be still handling the (total_size >= 2048)
> case by setting can_merge_uploads to false earlier in the function.
> 
> But, would you rather have the total_size < 2048 down lower for code
> readability? Is so, I can replace can_merge_uploads with
> instance_divisor_used, and use:
>   else if ((total_size < 2048) && !instance_divisor_used) {

My only problem was moving the test up into the loop, when you only need
to test it once -- this is the hottest path in the driver, and we've
already got way too much code in it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120612/931a9ab8/attachment.pgp>


More information about the mesa-dev mailing list