[Mesa-dev] [PATCH V3 09/13] i965: implement indirect drawing for Gen7

Eric Anholt eric at anholt.net
Tue Nov 12 15:23:34 PST 2013


Chris Forbes <chrisf at ijw.co.nz> writes:

> Just prior to emitting the 3DPRIMITIVE command, we load each of the
> indirect registers. The values loaded are either from offsets into the
> current indirect BO, or constant zero if the parameter is not used for
> this draw.
>
> Enabling use of the indirect registers is done by turning on a bit in
> the first dword of the 3DPRIMITIVE command itself.
>
> V3: - Deduplicate the common part of both indexed and nonindexed indirect
> setup.
>     - Just refer to the indirect bo out of the context directly.
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_draw.c | 57 ++++++++++++++++++++++++++++++++++--
>  1 file changed, 55 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
> index 0893b6d..4b50666 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw.c
> @@ -206,9 +208,60 @@ static void brw_emit_prim(struct brw_context *brw,
>        intel_batchbuffer_emit_mi_flush(brw);
>     }
>  
> +   /* If indirect, emit a bunch of loads from the indirect BO. */
> +   if (prim->is_indirect) {
> +      struct gl_buffer_object *indirect_buffer = brw->ctx.DrawIndirectBuffer;
> +      drm_intel_bo *bo = intel_bufferobj_buffer(brw,
> +            intel_buffer_object(indirect_buffer),
> +            0, indirect_buffer->Size);

This would be better as:

      drm_intel_bo *bo =
            intel_bufferobj_buffer(brw,
                                   intel_buffer_object(indirect_buffer),
                                   prim->indirect_offset, 20);

so you tell the subdata hack the right information (Note that overflow
is safe).

Other than that, and sorting out the resolution of the prim_count == 0
stuff with others (I don't care much), this series is:

Reviewed-by: Eric Anholt <eric at anholt.net>

Sorry for not sending out the individual reviews I'd done on the
previous set of patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131112/34a2afdf/attachment.pgp>


More information about the mesa-dev mailing list