From d4dd5a95a8a467a696e5160f3c9c72711829d95e Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Sat, 24 Mar 2007 13:01:57 +0100 Subject: [PATCH] r300: Fix: KIL instruction don't require textures When no textures were enabled, a KIL instruction triggered an assertion in r300_setup_rs_unit. --- src/mesa/drivers/dri/r300/r300_state.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 47f1546c07e..ef23a61618a 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1210,7 +1210,7 @@ void r300_setup_textures(GLcontext *ctx) r300ContextPtr r300 = R300_CONTEXT(ctx); int hw_tmu=0; int last_hw_tmu=-1; /* -1 translates into no setup costs for fields */ - int tmu_mappings[R300_MAX_TEXTURE_UNITS] = { -1 }; + int tmu_mappings[R300_MAX_TEXTURE_UNITS] = { -1, }; struct r300_fragment_program *rp = (struct r300_fragment_program *) (char *)ctx->FragmentProgram._Current; @@ -1307,10 +1307,14 @@ void r300_setup_textures(GLcontext *ctx) val = rp->tex.inst[i]; val &= ~R300_FPITX_IMAGE_MASK; - assert(tmu_mappings[unit] >= 0); + if (((val >> R300_FPITX_OPCODE_SHIFT) & 7) == R300_FPITX_OP_KIL) { + r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + } else { + assert(tmu_mappings[unit] >= 0); - val |= tmu_mappings[unit] << R300_FPITX_IMAGE_SHIFT; - r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + val |= tmu_mappings[unit] << R300_FPITX_IMAGE_SHIFT; + r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + } } r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, rp->tex.length); -- 2.30.2