summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-17 12:31:13 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-17 12:31:13 -0600
commit48b09322ee1b701558e1f223320cd2a9259bb37f (patch)
tree05ac5c38aee91ae8b4417559c7ac0b5d991fd5e2 /src/mesa/pipe/softpipe
parenta2805a81658fd4a4b9732167f24f334630549fa6 (diff)
write outputs according to vs.outputs_written
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_draw_arrays.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_draw_arrays.c b/src/mesa/pipe/softpipe/sp_draw_arrays.c
index be03ae8657..8f684ba00a 100644
--- a/src/mesa/pipe/softpipe/sp_draw_arrays.c
+++ b/src/mesa/pipe/softpipe/sp_draw_arrays.c
@@ -171,9 +171,12 @@ run_vertex_program(struct draw_context *draw,
#endif
/* store machine results */
+ assert(sp->vs.outputs_written & (1 << VERT_RESULT_HPOS));
for (j = 0; j < count; j++) {
+ unsigned attr;
float x, y, z, w;
+ /* Handle attr[0] (position) specially: */
x = vOut[j]->clip[0] = outputs[0].xyzw[0].f[j];
y = vOut[j]->clip[1] = outputs[0].xyzw[1].f[j];
z = vOut[j]->clip[2] = outputs[0].xyzw[2].f[j];
@@ -199,10 +202,16 @@ run_vertex_program(struct draw_context *draw,
vOut[j]->data[0][1],
vOut[j]->data[0][2]);
#endif
- vOut[j]->data[1][0] = outputs[1].xyzw[0].f[j];
- vOut[j]->data[1][1] = outputs[1].xyzw[1].f[j];
- vOut[j]->data[1][2] = outputs[1].xyzw[2].f[j];
- vOut[j]->data[1][3] = outputs[1].xyzw[3].f[j];
+
+ /* remaining attributes: */
+ 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];
+ }
+ }
}
#if 0