llvmpipe: handle FACING interpolants in line and point setup
authorKeith Whitwell <keithw@vmware.com>
Fri, 24 Sep 2010 09:30:52 +0000 (10:30 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 25 Sep 2010 11:21:55 +0000 (12:21 +0100)
src/gallium/drivers/llvmpipe/lp_setup_line.c
src/gallium/drivers/llvmpipe/lp_setup_point.c

index 829eb8a5a045e8a005bdb93d9c668fbb48f9cbd6..156bd633754510c467f2703b5d1e5f9f650f08a7 100644 (file)
@@ -208,6 +208,12 @@ static void setup_line_coefficients( struct lp_setup_context *setup,
          fragcoord_usage_mask |= usage_mask;
          break;
 
+      case LP_INTERP_FACING:
+         for (i = 0; i < NUM_CHANNELS; i++)
+            if (usage_mask & (1 << i))
+               constant_coef(setup, tri, slot+1, 1.0, i);
+         break;
+
       default:
          assert(0);
       }
index 2c354d1d0ed9c079116619ce013f2e175525908a..a95c15751ccef33723ed41272e1d829ca4094b49 100644 (file)
@@ -232,13 +232,23 @@ setup_point_coefficients( struct lp_setup_context *setup,
                break;                     
             }
          }
-
-         /* Otherwise fallthrough */
-      default:
+         /* FALLTHROUGH */
+      case LP_INTERP_CONSTANT:
          for (i = 0; i < NUM_CHANNELS; i++) {
             if (usage_mask & (1 << i))
                constant_coef(setup, point, slot+1, info->v0[vert_attr][i], i);
          }
+         break;
+
+      case LP_INTERP_FACING:
+         for (i = 0; i < NUM_CHANNELS; i++)
+            if (usage_mask & (1 << i))
+               constant_coef(setup, point, slot+1, 1.0, i);
+         break;
+
+      default:
+         assert(0);
+         break;
       }
    }