[Mesa-dev] [PATCH V2 10/15] i965: flag new indirect buffer in brw_try_draw_prims

Chris Forbes chrisf at ijw.co.nz
Thu Nov 7 14:46:42 PST 2013


The current plan I think is just to drop the extra state in brw, and
just reference the indirect bo directly when we need it [see Eric's
comment on 09/15]

On Fri, Nov 8, 2013 at 11:41 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> On 6 November 2013 23:06, Chris Forbes <chrisf at ijw.co.nz> wrote:
>>
>> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
>> ---
>>  src/mesa/drivers/dri/i965/brw_draw.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c
>> b/src/mesa/drivers/dri/i965/brw_draw.c
>> index e6c3508..9f8ad45 100644
>> --- a/src/mesa/drivers/dri/i965/brw_draw.c
>> +++ b/src/mesa/drivers/dri/i965/brw_draw.c
>> @@ -323,7 +323,8 @@ static bool brw_try_draw_prims( struct gl_context
>> *ctx,
>>                                      GLuint nr_prims,
>>                                      const struct _mesa_index_buffer *ib,
>>                                      GLuint min_index,
>> -                                    GLuint max_index )
>> +                                    GLuint max_index,
>> +                                    const struct gl_buffer_object
>> *indirect)
>>  {
>>     struct brw_context *brw = brw_context(ctx);
>>     bool retval = true;
>> @@ -377,6 +378,9 @@ static bool brw_try_draw_prims( struct gl_context
>> *ctx,
>>     brw->vb.max_index = max_index;
>>     brw->state.dirty.brw |= BRW_NEW_VERTICES;
>>
>> +   brw->indirect_buffer.indb = indirect;
>> +   brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;
>> +
>
>
> It seems wasteful to flag this bit on every draw call.  Couldn't we do
> something like this?
>
> if (brw->indirect_buffer.indb != NULL || indirect != NULL) {
>    brw->indirect_buffer.indb = indirect;
>    brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;
> }
>
> Assuming that's addressed, this patch is:
>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>
>
>>
>>     for (i = 0; i < nr_prims; i++) {
>>        int estimated_max_prim_size;
>>
>> @@ -506,7 +510,7 @@ void brw_draw_prims( struct gl_context *ctx,
>>      * manage it.  swrast doesn't support our featureset, so we can't fall
>> back
>>      * to it.
>>      */
>> -   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index,
>> max_index);
>> +   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index,
>> max_index, indirect);
>>  }
>>
>>  void brw_draw_init( struct brw_context *brw )
>> --
>> 1.8.4.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>


More information about the mesa-dev mailing list