diff options
author | Oliver McFadden <[email protected]> | 2007-07-14 18:11:45 +0000 |
---|---|---|
committer | Oliver McFadden <[email protected]> | 2007-07-14 18:12:04 +0000 |
commit | 491f646c798ec2f20ba5a6adc600bc7ea92ddf24 (patch) | |
tree | a4b1388f7508f8fd6b8648e66aa1c57eb97069d4 /src/mesa | |
parent | 24f85f047b8b9e9b465bd3f9af2cc113582bfc0d (diff) |
r300: Clean up the vertex program output assignment.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertprog.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index d5cae478539..a40fb4f4ac9 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -439,41 +439,43 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp, /* Assign outputs */ if (vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) { - vp->outputs[VERT_RESULT_HPOS] = cur_reg; - cur_reg = 1; + vp->outputs[VERT_RESULT_HPOS] = cur_reg++; } if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) { - vp->outputs[VERT_RESULT_COL0] = 1; - cur_reg = 2; + vp->outputs[VERT_RESULT_COL0] = cur_reg++; } if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) { - vp->outputs[VERT_RESULT_COL1] = 2; - cur_reg = 3; + vp->outputs[VERT_RESULT_COL1] = vp->outputs[VERT_RESULT_COL0] + 1; + cur_reg = vp->outputs[VERT_RESULT_COL1] + 1; } if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) { - vp->outputs[VERT_RESULT_BFC0] = 3; - cur_reg = 5; + vp->outputs[VERT_RESULT_BFC0] = vp->outputs[VERT_RESULT_COL0] + 2; + cur_reg = vp->outputs[VERT_RESULT_BFC0] + 1; } if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) { - vp->outputs[VERT_RESULT_BFC1] = 4; - cur_reg = 5; + vp->outputs[VERT_RESULT_BFC1] = vp->outputs[VERT_RESULT_COL0] + 3; + cur_reg = vp->outputs[VERT_RESULT_BFC1] + 1; } -#if 0 /* Not supported yet */ - if (vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) + +#if 0 + if (vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) { vp->outputs[VERT_RESULT_FOGC] = cur_reg++; -#endif + } - if (vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) { vp->outputs[VERT_RESULT_PSIZ] = cur_reg++; + } +#endif - for (i = VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) + for (i = VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) { if (vp->key.OutputsWritten & (1 << i)) { vp->outputs[i] = cur_reg++; } + } vp->translated = GL_TRUE; vp->native = GL_TRUE; |