<div dir="ltr">On 21 March 2013 08:56, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</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">
<div class="im">Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> writes:<br>
<br>
> Currently, the GPU pipeline has one active VUE map in effect at any<br>
> given time--the one representing the layout of vertex data coming from<br>
> the vertex shader. However, when geometry shaders are added, they<br>
> will have their own independent VUE map. Later pipeline stages (clip,<br>
> sf, fs) will need to consult the geometry shader VUE map if a geometry<br>
> shader is in use, and the vertex shader VUE map otherwise.<br>
><br>
> This patch adds a new field to brw_context, vue_map_geom_out, which<br>
> points to whichever VUE map should be used by later pipeline stages.<br>
> It also adds a new state flag, BRW_NEW_VUE_MAP_GEOM_OUT, which is<br>
> signalled whenever this pointer changes.<br>
><br>
> Since we don't support geometry shaders yet, vue_map_geom_out is<br>
> currently set only by the brw_vs_prog state atom.<br>
> ---<br>
<br>
</div><div class="im">> diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c<br>
> index d875703..214730d 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_vs.c<br>
> +++ b/src/mesa/drivers/dri/i965/brw_vs.c<br>
> @@ -314,6 +314,8 @@ do_vs_prog(struct brw_context *brw,<br>
> program, program_size,<br>
> &c.prog_data, sizeof(c.prog_data),<br>
> &brw->vs.prog_offset, &brw->vs.prog_data);<br>
> + brw->vue_map_geom_out = &brw->vs.prog_data->vue_map;<br>
> + brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT;<br>
> ralloc_free(mem_ctx);<br>
<br>
</div>I think the one below in upload_vs_prog should be sufficient, since it<br>
always happens immediately after this.<br></blockquote><div><br></div><div>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.<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>
><br>
> return true;<br>
> @@ -488,6 +490,8 @@ static void brw_upload_vs_prog(struct brw_context *brw)<br>
><br>
> assert(success);<br>
> }<br>
> + brw->vue_map_geom_out = &brw->vs.prog_data->vue_map;<br>
> + brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT;<br>
> }<br>
</div></div></blockquote></div><br></div></div>