From 48b09322ee1b701558e1f223320cd2a9259bb37f Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 17 Aug 2007 12:31:13 -0600 Subject: [PATCH] write outputs according to vs.outputs_written --- src/mesa/pipe/softpipe/sp_draw_arrays.c | 17 +++++++++++++---- 1 file 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 be03ae8..8f684ba 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 -- 2.7.4