Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / gallium / drivers / llvmpipe / lp_setup_point.c
index e30e70e16d2eb1b4c1658a9cc033530295a99c81..146f1bd07ca1f5c24ee731b3f17f9bbb95cbd27e 100644 (file)
@@ -35,6 +35,7 @@
 #include "lp_perf.h"
 #include "lp_rast.h"
 #include "lp_state_fs.h"
+#include "lp_state_setup.h"
 #include "tgsi/tgsi_scan.h"
 
 #define NUM_CHANNELS 4
@@ -205,17 +206,18 @@ static void
 setup_point_coefficients( struct lp_setup_context *setup,
                           struct point_info *info)
 {
+   const struct lp_setup_variant_key *key = &setup->setup.variant->key;
    const struct lp_fragment_shader *shader = setup->fs.current.variant->shader;
    unsigned fragcoord_usage_mask = TGSI_WRITEMASK_XYZ;
    unsigned slot;
 
    /* setup interpolation for all the remaining attributes:
     */
-   for (slot = 0; slot < setup->fs.nr_inputs; slot++) {
-      enum lp_interp interp = setup->fs.input[slot].interp;
+   for (slot = 0; slot < key->num_inputs; slot++) {
+      unsigned vert_attr = key->inputs[slot].src_index;
+      unsigned usage_mask = key->inputs[slot].usage_mask;
+      enum lp_interp interp = key->inputs[slot].interp;
       boolean perspective = !!(interp == LP_INTERP_PERSPECTIVE);
-      unsigned vert_attr = setup->fs.input[slot].src_index;
-      unsigned usage_mask = setup->fs.input[slot].usage_mask;
       unsigned i;
 
       if (perspective & usage_mask) {
@@ -301,6 +303,7 @@ try_setup_point( struct lp_setup_context *setup,
                  const float (*v0)[4] )
 {
    /* x/y positions in fixed point */
+   const struct lp_setup_variant_key *key = &setup->setup.variant->key;
    const int sizeAttr = setup->psize;
    const float size
       = (setup->point_size_per_vertex && sizeAttr > 0) ? v0[sizeAttr][0]
@@ -352,7 +355,7 @@ try_setup_point( struct lp_setup_context *setup,
    u_rect_find_intersection(&setup->draw_region, &bbox);
 
    point = lp_setup_alloc_triangle(scene,
-                                   setup->fs.nr_inputs,
+                                   key->num_inputs,
                                    nr_planes,
                                    &bytes);
    if (!point)
@@ -386,25 +389,21 @@ try_setup_point( struct lp_setup_context *setup,
       plane[0].dcdx = -1;
       plane[0].dcdy = 0;
       plane[0].c = 1-bbox.x0;
-      plane[0].ei = 0;
       plane[0].eo = 1;
 
       plane[1].dcdx = 1;
       plane[1].dcdy = 0;
       plane[1].c = bbox.x1+1;
-      plane[1].ei = -1;
       plane[1].eo = 0;
 
       plane[2].dcdx = 0;
       plane[2].dcdy = 1;
       plane[2].c = 1-bbox.y0;
-      plane[2].ei = 0;
       plane[2].eo = 1;
 
       plane[3].dcdx = 0;
       plane[3].dcdy = -1;
       plane[3].c = bbox.y1+1;
-      plane[3].ei = -1;
       plane[3].eo = 0;
    }