From 2d4ff6a8cf83ca3a829021482b08b95bea7aa31a Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Mon, 9 Jan 2006 22:53:38 +0000 Subject: Missing patch from Ben Skeggs: Lots of changes, and fixes for some badness on my behalf. 1. Disposable data used during fp compile is now per-context, rather than per-program to save memory. 2. Track usage of INPUT/TEMP registers from Mesa program, free them when no longer required so the hw temps can be re-used. 3. Changed LAST_NODE to OUTPUT_COLOR (see r300_reg.h) 4. Implemented remaining ARB_f_p instructions, with the exception of the trig/LIT opcodes. 5. Treat ZERO/ONE swizzles the same way as other native swizzles. 6. emit_arith changes, basically a complete re-write. Should produce cleaner instructions, but no real functional changes. internal reg -> hw reg routines shared with emit_tex. A bit messy still. --- src/mesa/drivers/dri/r300/r300_state.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_state.c') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 52a3a4479d..52fc158144 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1233,8 +1233,8 @@ void r300_setup_rs_unit(GLcontext *ctx) vp_reg++; } else { /* Passing invalid data here can lock the GPU. */ - fprintf(stderr, "fragprog wants coords for tex%d, vp doesn't provide them!\n", i); - exit(-1); + WARN_ONCE("fragprog wants coords for tex%d, vp doesn't provide them!\n", i); + //exit(-1); } InputsRead &= ~(FRAG_BIT_TEX0<hw.rr.cmd[R300_RR_ROUTE_0] |= 0 @@ -1256,8 +1256,8 @@ void r300_setup_rs_unit(GLcontext *ctx) if (InputsRead & FRAG_BIT_COL1) { if (!(OutputsWritten & (hw_tcl_on ? (1<hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 @@ -1649,7 +1649,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) translate_vertex_shader(vp); if (vp->translated == GL_FALSE) { fprintf(stderr, "Failing back to sw-tcl\n"); - debug_vp(ctx, &vp->mesa_program); +// debug_vp(ctx, &vp->mesa_program); hw_tcl_on = future_hw_tcl_on = 0; r300ResetHwState(rmesa); @@ -1739,8 +1739,7 @@ static unsigned int r300PackFloat24(float f) void r300SetupPixelShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; - struct r300_fragment_program *rp = - (struct r300_fragment_program *)ctx->FragmentProgram._Current; + struct r300_fragment_program *rp = ctx->FragmentProgram._Current; int i,k; if (!rp) /* should only happenen once, just after context is created */ @@ -1778,7 +1777,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa) | (rp->node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT) | (rp->node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) | (rp->node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT) - | ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); + | rp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ } else { rmesa->hw.fp.cmd[R300_FP_NODE0+(3-i)] = 0; } -- cgit v1.2.3