<div dir="ltr">On 7 November 2013 14:46, Chris Forbes <span dir="ltr"><<a href="mailto:chrisf@ijw.co.nz" target="_blank">chrisf@ijw.co.nz</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The current plan I think is just to drop the extra state in brw, and<br>
just reference the indirect bo directly when we need it [see Eric's<br>
comment on 09/15]<br></blockquote><div><br></div><div>Ah, ok, that makes sense. Thanks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On Fri, Nov 8, 2013 at 11:41 AM, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> On 6 November 2013 23:06, Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>> wrote:<br>
>><br>
>> Signed-off-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>><br>
>> ---<br>
>> src/mesa/drivers/dri/i965/brw_draw.c | 8 ++++++--<br>
>> 1 file changed, 6 insertions(+), 2 deletions(-)<br>
>><br>
>> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c<br>
>> b/src/mesa/drivers/dri/i965/brw_draw.c<br>
>> index e6c3508..9f8ad45 100644<br>
>> --- a/src/mesa/drivers/dri/i965/brw_draw.c<br>
>> +++ b/src/mesa/drivers/dri/i965/brw_draw.c<br>
>> @@ -323,7 +323,8 @@ static bool brw_try_draw_prims( struct gl_context<br>
>> *ctx,<br>
>> GLuint nr_prims,<br>
>> const struct _mesa_index_buffer *ib,<br>
>> GLuint min_index,<br>
>> - GLuint max_index )<br>
>> + GLuint max_index,<br>
>> + const struct gl_buffer_object<br>
>> *indirect)<br>
>> {<br>
>> struct brw_context *brw = brw_context(ctx);<br>
>> bool retval = true;<br>
>> @@ -377,6 +378,9 @@ static bool brw_try_draw_prims( struct gl_context<br>
>> *ctx,<br>
>> brw->vb.max_index = max_index;<br>
>> brw->state.dirty.brw |= BRW_NEW_VERTICES;<br>
>><br>
>> + brw->indirect_buffer.indb = indirect;<br>
>> + brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;<br>
>> +<br>
><br>
><br>
> It seems wasteful to flag this bit on every draw call. Couldn't we do<br>
> something like this?<br>
><br>
> if (brw->indirect_buffer.indb != NULL || indirect != NULL) {<br>
> brw->indirect_buffer.indb = indirect;<br>
> brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;<br>
> }<br>
><br>
> Assuming that's addressed, this patch is:<br>
><br>
> Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
><br>
>><br>
>> for (i = 0; i < nr_prims; i++) {<br>
>> int estimated_max_prim_size;<br>
>><br>
>> @@ -506,7 +510,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
>> * manage it. swrast doesn't support our featureset, so we can't fall<br>
>> back<br>
>> * to it.<br>
>> */<br>
>> - brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index,<br>
>> max_index);<br>
>> + brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index,<br>
>> max_index, indirect);<br>
>> }<br>
>><br>
>> void brw_draw_init( struct brw_context *brw )<br>
>> --<br>
>> 1.8.4.2<br>
>><br>
>> _______________________________________________<br>
>> mesa-dev mailing list<br>
>> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
>> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>