aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-04-09 10:12:02 -0600
committerBrian Paul <brianp@vmware.com>2010-04-09 10:12:02 -0600
commit08b98fac6243ff2f0c26dedc374d7cefff51fd38 (patch)
treecf6caaf47a461c4e2aaed9558466049cd3294e98 /src
parent65c337e29be884680e380b34b7542dca93824e00 (diff)
mesa: fix instruction indexing bugs
We were looping over instructions but only looking at the 0th instruction's opcode. Fixes fd.o bug 27566. (cherry picked from commit b22a00bff4aadd390dd8af6b5b05bd2833ec7f85)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/program.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index ef0c2768895..89cb4418786 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -623,7 +623,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;
@@ -650,7 +650,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 ||