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

Paul Berry stereotype441 at gmail.com
Thu Mar 21 13:37:05 PDT 2013


On 21 March 2013 08:56, Eric Anholt <eric at anholt.net> wrote:

> 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.
>

Oops, you're right.  In fact, I think it may lead to bugs to update the VUE
map from do_vs_prog(), since do_vs_prog() is also called during
precompilation.


>
> >
> >     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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130321/431a9af2/attachment.html>


More information about the mesa-dev mailing list