<div dir="ltr">On 29 March 2013 10:20, 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">
We are intentionally not allocating a slot for gl_ClipVertex. But by<br>
leaving the bit set in the slots_valid, the fragment shader's computation<br>
of where varyings are in urb entry coming out of the SF would be off by<br>
one. Fixes rendering in Freespace 2 SCP.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=62830" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=62830</a><br>
Tested-by: Joaquín Ignacio Aramendía <<a href="mailto:samsagax@gmail.com">samsagax@gmail.com</a>><br>
NOTE: This is a candidate for the 9.1 branch.<br>
---<br>
<br>
NOTE: I haven't run this through piglit yet, since I'm out of town.<br></blockquote><div><br></div><div>Assuming the piglit tests pass, this is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
src/mesa/drivers/dri/i965/brw_vs.c | 18 +++++++++++-------<br>
1 file changed, 11 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c<br>
index e093dd1..6d2c0fd 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vs.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_vs.c<br>
@@ -63,6 +63,13 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c,<br>
{<br>
const struct intel_context *intel = &brw->intel;<br>
struct brw_vue_map *vue_map = &c->prog_data.vue_map;<br>
+<br>
+ /* Prior to Gen6, don't assign a slot for VARYING_SLOT_CLIP_VERTEX, since<br>
+ * it is unsupported.<br>
+ */<br>
+ if (intel->gen < 6)<br>
+ slots_valid &= ~VARYING_BIT_CLIP_VERTEX;<br>
+<br>
vue_map->slots_valid = slots_valid;<br>
int i;<br>
<br>
@@ -152,15 +159,12 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c,<br>
* assign them contiguously. Don't reassign outputs that already have a<br>
* slot.<br>
*<br>
- * Also, prior to Gen6, don't assign a slot for VARYING_SLOT_CLIP_VERTEX,<br>
- * since it is unsupported. In Gen6 and above, VARYING_SLOT_CLIP_VERTEX may<br>
- * be needed for transform feedback; since we don't want to have to<br>
- * recompute the VUE map (and everything that depends on it) when transform<br>
- * feedback is enabled or disabled, just go ahead and assign a slot for it.<br>
+ * We generally don't need to assign a slot for VARYING_SLOT_CLIP_VERTEX,<br>
+ * since it's encoded as the clip distances by emit_clip_distances().<br>
+ * However, it may be output by transform feedback, and we'd rather not<br>
+ * recompute state when TF changes, so we just always include it.<br>
*/<br>
for (int i = 0; i < VARYING_SLOT_MAX; ++i) {<br>
- if (intel->gen < 6 && i == VARYING_SLOT_CLIP_VERTEX)<br>
- continue;<br>
if ((slots_valid & BITFIELD64_BIT(i)) &&<br>
vue_map->varying_to_slot[i] == -1) {<br>
assign_vue_slot(vue_map, i);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>