Mesa (master): i965: Don' t try to emit interpolation for unused varying slots.

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 28 21:54:55 UTC 2010


Module: Mesa
Branch: master
Commit: 17f3b8097d01a63917afaaefccd6eea070271652
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=17f3b8097d01a63917afaaefccd6eea070271652

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 28 14:53:36 2010 -0700

i965: Don't try to emit interpolation for unused varying slots.

Fixes:
glsl-fs-varying-array
glsl-texcoord-array
glsl-texcoord-array-2
glsl-vs-varying-array

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index fbd2464..feb0cc1 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -677,6 +677,15 @@ fs_visitor::emit_general_interpolation(ir_variable *ir)
    int location = ir->location;
    for (unsigned int i = 0; i < array_elements; i++) {
       for (unsigned int j = 0; j < type->matrix_columns; j++) {
+	 if (!(fp->Base.InputsRead & BITFIELD64_BIT(location))) {
+	    /* If there's no incoming setup data for this slot, don't
+	     * emit interpolation for it (since it's not used, and
+	     * we'd fall over later trying to find the setup data.
+	     */
+	    attr.reg_offset += type->vector_elements;
+	    continue;
+	 }
+
 	 for (unsigned int c = 0; c < type->vector_elements; c++) {
 	    struct brw_reg interp = interp_reg(location, c);
 	    emit(fs_inst(FS_OPCODE_LINTERP,




More information about the mesa-commit mailing list