[Mesa-dev] [PATCH 2/4] i965: Create a pointer in brw_context to the geometry output VUE map.

Eric Anholt eric at anholt.net
Thu Mar 21 08:56:56 PDT 2013


Paul Berry <stereotype441 at gmail.com> writes:

> Currently, the GPU pipeline has one active VUE map in effect at any
> given time--the one representing the layout of vertex data coming from
> the vertex shader.  However, when geometry shaders are added, they
> will have their own independent VUE map.  Later pipeline stages (clip,
> sf, fs) will need to consult the geometry shader VUE map if a geometry
> shader is in use, and the vertex shader VUE map otherwise.
>
> This patch adds a new field to brw_context, vue_map_geom_out, which
> points to whichever VUE map should be used by later pipeline stages.
> It also adds a new state flag, BRW_NEW_VUE_MAP_GEOM_OUT, which is
> signalled whenever this pointer changes.
>
> Since we don't support geometry shaders yet, vue_map_geom_out is
> currently set only by the brw_vs_prog state atom.
> ---

> diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
> index d875703..214730d 100644
> --- a/src/mesa/drivers/dri/i965/brw_vs.c
> +++ b/src/mesa/drivers/dri/i965/brw_vs.c
> @@ -314,6 +314,8 @@ do_vs_prog(struct brw_context *brw,
>  		    program, program_size,
>  		    &c.prog_data, sizeof(c.prog_data),
>  		    &brw->vs.prog_offset, &brw->vs.prog_data);
> +   brw->vue_map_geom_out = &brw->vs.prog_data->vue_map;
> +   brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT;
>     ralloc_free(mem_ctx);

I think the one below in upload_vs_prog should be sufficient, since it
always happens immediately after this.

>  
>     return true;
> @@ -488,6 +490,8 @@ static void brw_upload_vs_prog(struct brw_context *brw)
>  
>        assert(success);
>     }
> +   brw->vue_map_geom_out = &brw->vs.prog_data->vue_map;
> +   brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT;
>  }
-------------- 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/20130321/7cbdf0ee/attachment.pgp>


More information about the mesa-dev mailing list