diff options
author | Nicolai Haehnle <[email protected]> | 2007-03-24 13:01:57 +0100 |
---|---|---|
committer | Nicolai Haehnle <[email protected]> | 2007-03-24 14:43:06 +0100 |
commit | d4dd5a95a8a467a696e5160f3c9c72711829d95e (patch) | |
tree | db9d95feb159c61bccc33e0a54647d705d030923 /src/mesa/drivers | |
parent | 8f90822b7264a6e569707fb187a77de57a6e6dac (diff) |
r300: Fix: KIL instruction don't require textures
When no textures were enabled, a KIL instruction triggered an assertion
in r300_setup_rs_unit.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 12 |
1 files 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); |