<div dir="ltr">On 14 July 2013 02:39, Chris Forbes <span dir="ltr"><<a href="mailto:chrisf@ijw.co.nz" target="_blank">chrisf@ijw.co.nz</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">
This patch ensures that integers will pass through unscathed. Doing<br>
(useless) computations on them is risky, especially when their bit<br>
patterns correspond to values like inf or nan.<br>
<br>
[V1-2]: Signed-off-by: Olivier Galibert <galibert at <a href="http://pobox.com" target="_blank">pobox.com</a>><br>
Signed-off-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_clip_util.c | 57 ++++++++++++++++++-------------<br>
1 file changed, 34 insertions(+), 23 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c<br>
index 56c9ccd..a168b32 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c<br>
@@ -246,8 +246,8 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,<br>
int varying = c->vue_map.slot_to_varying[slot];<br>
GLuint delta = brw_vue_slot_to_offset(slot);<br>
<br>
- /* HPOS is already handled above */<br>
- if (varying == VARYING_SLOT_POS)<br>
+ /* HPOS, NDC already handled above */<br>
+ if (varying == VARYING_SLOT_POS || varying == BRW_VARYING_SLOT_NDC)<br>
continue;<br></blockquote><div><br></div><div>Was this hunk supposed to go in patch 4/5?<br><br>With that fixed, this patch 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>
<br>
@@ -269,28 +269,39 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,<br>
* header), so interpolate:<br>
*<br>
* New = attr0 + t*attr1 - t*attr0<br>
+ *<br>
+ * Unless the attribute is flat shaded -- in which case just copy<br>
+ * from one of the sources (doesn't matter which; already copied from pv)<br>
*/<br>
- struct brw_reg tmp = get_tmp(c);<br>
- struct brw_reg t =<br>
- c->key.interpolation_mode[slot] == INTERP_QUALIFIER_NOPERSPECTIVE ?<br>
- t_nopersp : t0;<br>
-<br>
- brw_MUL(p,<br>
- vec4(brw_null_reg()),<br>
- deref_4f(v1_ptr, delta),<br>
- t);<br>
-<br>
- brw_MAC(p,<br>
- tmp,<br>
- negate(deref_4f(v0_ptr, delta)),<br>
- t);<br>
-<br>
- brw_ADD(p,<br>
- deref_4f(dest_ptr, delta),<br>
- deref_4f(v0_ptr, delta),<br>
- tmp);<br>
-<br>
- release_tmp(c, tmp);<br>
+ GLuint interp = c->key.interpolation_mode[slot];<br>
+<br>
+ if (interp != INTERP_QUALIFIER_FLAT) {<br>
+ struct brw_reg tmp = get_tmp(c);<br>
+ struct brw_reg t =<br>
+ interp == INTERP_QUALIFIER_NOPERSPECTIVE ? t_nopersp : t0;<br>
+<br>
+ brw_MUL(p,<br>
+ vec4(brw_null_reg()),<br>
+ deref_4f(v1_ptr, delta),<br>
+ t);<br>
+<br>
+ brw_MAC(p,<br>
+ tmp,<br>
+ negate(deref_4f(v0_ptr, delta)),<br>
+ t);<br>
+<br>
+ brw_ADD(p,<br>
+ deref_4f(dest_ptr, delta),<br>
+ deref_4f(v0_ptr, delta),<br>
+ tmp);<br>
+<br>
+ release_tmp(c, tmp);<br>
+ }<br>
+ else {<br>
+ brw_MOV(p,<br>
+ deref_4f(dest_ptr, delta),<br>
+ deref_4f(v0_ptr, delta));<br>
+ }<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.2<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>