machine.Inputs[attr].xyzw[1].f[j] = p[1]; /*Y*/
machine.Inputs[attr].xyzw[2].f[j] = p[2]; /*Z*/
machine.Inputs[attr].xyzw[3].f[j] = 1.0; /*W*/
+#if 0
+ if (attr == 0) {
+ printf("Input vertex %d: %f %f %f\n",
+ j, p[0], p[1], p[2]);
+ }
+#endif
}
}
}
/* store machine results */
assert(sp->vs.outputs_written & (1 << VERT_RESULT_HPOS));
for (j = 0; j < count; j++) {
- unsigned attr;
+ unsigned attr, slot;
float x, y, z, w;
/* Handle attr[0] (position) specially: */
w = vOut[j]->clip[3] = outputs[0].xyzw[3].f[j];
vOut[j]->clipmask = compute_clipmask(x, y, z, w);
- vOut[j]->edgeflag = 0;
+ vOut[j]->edgeflag = 1;
/* divide by w */
w = 1.0 / w;
#endif
/* remaining attributes: */
+ /* pack into sequential post-transform attrib slots */
+ slot = 1;
for (attr = 1; attr < VERT_RESULT_MAX; attr++) {
if (sp->vs.outputs_written & (1 << attr)) {
- vOut[j]->data[attr][0] = outputs[attr].xyzw[0].f[j];
- vOut[j]->data[attr][1] = outputs[attr].xyzw[1].f[j];
- vOut[j]->data[attr][2] = outputs[attr].xyzw[2].f[j];
- vOut[j]->data[attr][3] = outputs[attr].xyzw[3].f[j];
+ assert(slot < draw->nr_attrs - 2);
+ vOut[j]->data[slot][0] = outputs[attr].xyzw[0].f[j];
+ vOut[j]->data[slot][1] = outputs[attr].xyzw[1].f[j];
+ vOut[j]->data[slot][2] = outputs[attr].xyzw[2].f[j];
+ vOut[j]->data[slot][3] = outputs[attr].xyzw[3].f[j];
+ slot++;
}
}
}