nvc0: sprite coord enable is per GENERIC, not overall index
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 23 Feb 2011 14:00:26 +0000 (15:00 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 24 Feb 2011 16:35:36 +0000 (17:35 +0100)
src/gallium/drivers/nvc0/nvc0_state_validate.c

index 0cc0a0c623685acdc67bbdfc4af7616e46f0f8b8..70c418fad9b6706f1f6eaa2a4c96201578929f72 100644 (file)
@@ -302,14 +302,12 @@ nvc0_validate_sprite_coords(struct nvc0_context *nvc0)
 
    if (nvc0->rast->pipe.point_quad_rasterization) {
       uint32_t en = nvc0->rast->pipe.sprite_coord_enable;
-      int i;
-      struct nvc0_program *prog = nvc0->fragprog;
 
       while (en) {
-         i = ffs(en) - 1;
+         int i = ffs(en) - 1;
          en &= ~(1 << i);
-         if (prog->fp.in_pos[i] >= 0xc0 && prog->fp.in_pos[i] < 0xe0)
-            reg |= 8 << ((prog->fp.in_pos[i] - 0xc0) / 4);
+         if (i >= 0 && i < 8)
+            reg |= 8 << i;
       }
    }