summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-08-26 12:17:56 -0700
committerPaul Berry <[email protected]>2011-09-06 11:05:34 -0700
commit4efb32c642507228d5bfebbd6d403dd9944f9b7c (patch)
treed676af484a6e31314e74e97b025e8b14ffbe5ead /src/mesa/drivers
parent71cb82f63ab156599613f7555a62ad52d2e3dbd7 (diff)
i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()
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. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_util.c13
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 8c9f0e49575..a12dab6b350 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
*/