From: Brian Paul Date: Fri, 9 Apr 2010 16:03:31 +0000 (-0600) Subject: mesa: fix instruction indexing bugs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b22a00bff4aadd390dd8af6b5b05bd2833ec7f85;p=mesa.git mesa: fix instruction indexing bugs We were looping over instructions but only looking at the 0th instruction's opcode. Fixes fd.o bug 27566. --- diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index f4f701b5461..f77a7737530 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -625,7 +625,7 @@ replace_registers(struct prog_instruction *inst, GLuint numInst, GLuint i, j; for (i = 0; i < numInst; i++) { /* src regs */ - for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) { + for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) { if (inst[i].SrcReg[j].File == oldFile && inst[i].SrcReg[j].Index == oldIndex) { inst[i].SrcReg[j].File = newFile; @@ -652,7 +652,7 @@ adjust_param_indexes(struct prog_instruction *inst, GLuint numInst, { GLuint i, j; for (i = 0; i < numInst; i++) { - for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) { + for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) { GLuint f = inst[i].SrcReg[j].File; if (f == PROGRAM_CONSTANT || f == PROGRAM_UNIFORM ||