From 2d2f5a4b19a95477e1cf6915963fe9fdbfc461f7 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 8 Jun 2005 15:05:19 +0000 Subject: - Secondary colour - Calculate tc_count in EmitArrays (enabled units != nr texcoords). --- src/mesa/drivers/dri/r300/r300_fragprog.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_fragprog.c') diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 599facee31..19dab8f84b 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -941,24 +941,29 @@ void init_program(struct r300_fragment_program *rp) /* Work out what temps the Mesa inputs correspond to, this must match * what setup_rs_unit does, which shouldn't be a problem as rs_unit * configures itself based on the fragprog's InputsRead + * + * I'm using get_hw_temp() here now rather than doing this manually. + * This depends on get_hw_temp() allocating registers in order, starting + * at 0 (which it currently does). */ /* Texcoords come first */ for (i=0;ictx->Const.MaxTextureUnits;i++) { - if (InputsRead & (FRAG_BIT_TEX0 << i)) { - rp->hwreg_in_use |= (1<inputs[FRAG_ATTRIB_TEX0+i] = fp_reg++; - } + if (InputsRead & (FRAG_BIT_TEX0 << i)) + rp->inputs[FRAG_ATTRIB_TEX0+i] = get_hw_temp(rp); } InputsRead &= ~FRAG_BITS_TEX_ANY; /* Then primary colour */ - if (InputsRead & FRAG_BIT_COL0) { - rp->hwreg_in_use |= (1<inputs[FRAG_ATTRIB_COL0] = fp_reg++; - } + if (InputsRead & FRAG_BIT_COL0) + rp->inputs[FRAG_ATTRIB_COL0] = get_hw_temp(rp); InputsRead &= ~FRAG_BIT_COL0; - + + /* Secondary color */ + if (InputsRead & FRAG_BIT_COL1) + rp->inputs[FRAG_ATTRIB_COL1] = get_hw_temp(rp); + InputsRead &= ~FRAG_BIT_COL1; + /* Anything else */ if (InputsRead) { WARN_ONCE("Don't know how to handle inputs 0x%x\n", InputsRead); -- cgit v1.2.3