[Mesa-dev] [PATCH 34/36] i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()
Paul Berry
stereotype441 at gmail.com
Fri Sep 2 09:07:13 PDT 2011
Previously, brw_clip_interp_vertex() iterated only through the
"non-header" elements of the VUE when performing interpolation
(because header elements don't need interpolation). This code now
refers exclusively to the VUE map to figure out which elements need
interpolation, so that brw_clip_interp_vertex() doesn't need to know
the header size.
---
src/mesa/drivers/dri/i965/brw_clip_util.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c
index 8c9f0e4..a12dab6 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c
@@ -151,17 +151,20 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
/* Iterate over each attribute (could be done in pairs?)
*/
- for (slot = 2*c->header_regs; slot < c->vue_map.num_slots; slot++) {
+ for (slot = 0; slot < c->vue_map.num_slots; slot++) {
+ int vert_result = c->vue_map.slot_to_vert_result[slot];
GLuint delta = brw_vue_slot_to_offset(slot);
- if (c->vue_map.slot_to_vert_result[slot] == VERT_RESULT_EDGE) {
+ if (vert_result == VERT_RESULT_EDGE) {
if (force_edgeflag)
brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1));
else
brw_MOV(p, deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta));
- }
- else {
- /* Interpolate:
+ } else if (vert_result == VERT_RESULT_PSIZ) {
+ /* PSIZ doesn't need interpolation */
+ } else if (vert_result < VERT_RESULT_MAX) {
+ /* This is a true vertex result (and not a special value for the VUE
+ * header), so interpolate:
*
* New = attr0 + t*attr1 - t*attr0
*/
--
1.7.6
More information about the mesa-dev
mailing list