Index: src/mesa/drivers/dri/i915/i915_debug.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_debug.c,v retrieving revision 1.3 diff -u -r1.3 i915_debug.c --- src/mesa/drivers/dri/i915/i915_debug.c 20 Jul 2004 21:17:03 -0000 1.3 +++ src/mesa/drivers/dri/i915/i915_debug.c 10 Aug 2006 23:19:25 -0000 @@ -247,7 +247,7 @@ static void print_tex_op( GLuint opcode, const GLuint *program ) { - print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); + print_dest_reg(program[0]); fprintf(stderr, " = "); fprintf(stderr, "%s ", opcodes[opcode]); Index: src/mesa/drivers/dri/i915/i915_program.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_program.c,v retrieving revision 1.5 diff -u -r1.5 i915_program.c --- src/mesa/drivers/dri/i915/i915_program.c 1 Nov 2005 04:36:33 -0000 1.5 +++ src/mesa/drivers/dri/i915/i915_program.c 10 Aug 2006 23:19:25 -0000 @@ -201,20 +201,42 @@ GLuint coord, GLuint op ) { + GLuint old_utemp_flag; + GLuint fakeDest = dest; assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST); assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest))); if (GET_UREG_TYPE(coord) != REG_TYPE_T) { p->nr_tex_indirect++; } + + /* Apparently texld does not support write masks. + * Emulate one by texld-ing to a temporary register + * and MOV from that with to the actual destination, + * writemasked. */ + if (destmask != A0_DEST_CHANNEL_ALL) + { + old_utemp_flag = p->utemp_flag; + /* Set texld dest to temporary */ + fakeDest = i915_get_utemp(p); + } *(p->csr++) = (op | - T0_DEST( dest ) | - destmask | + T0_DEST( fakeDest ) | + A0_DEST_CHANNEL_ALL | T0_SAMPLER( sampler )); *(p->csr++) = T1_ADDRESS_REG( coord ); *(p->csr++) = T2_MBZ; + + if (destmask != A0_DEST_CHANNEL_ALL) + { + /* MOV to actual destination */ + i915_emit_arith( p, A0_MOV, dest, destmask, 0, + fakeDest, 0, 0 ); + + p->utemp_flag = old_utemp_flag; /* restore */ + } p->nr_tex_insn++; return dest;