[Mesa-dev] [PATCH V3 2/5] i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3

Chris Forbes chrisf at ijw.co.nz
Tue Jul 30 14:06:23 PDT 2013


On Wed, Jul 31, 2013 at 8:53 AM, Paul Berry <stereotype441 at gmail.com> wrote:
>Can you point me to some VS code that does this?  I thought that if the VS wrote only to gl_BackColor, then the VUE map would only contain a slot for gl_BackColor.

The VS now does this:

diff --git a/src/mesa/drivers/dri/i965/
brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 60b40c5..5b8173d 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -277,6 +277,12 @@ do_vs_prog(struct brw_context *brw,
          if (c.key.point_coord_replace & (1 << i))
             outputs_written |= BITFIELD64_BIT(VARYING_SLOT_TEX0 + i);
       }
+
+      /* if back colors are written, allocate slots for front colors too */
+      if (outputs_written & BITFIELD64_BIT(VARYING_SLOT_BFC0))
+         outputs_written |= BITFIELD64_BIT(VARYING_SLOT_COL0);
+      if (outputs_written & BITFIELD64_BIT(VARYING_SLOT_BFC1))
+         outputs_written |= BITFIELD64_BIT(VARYING_SLOT_COL1);
    }

    brw_compute_vue_map(brw, &prog_data.base.vue_map, outputs_written,


More information about the mesa-dev mailing list