OSDN Git Service

mesa: update program->NumAddressRegs field in _slang_update_inputs_outputs()
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 17 Sep 2008 19:13:02 +0000 (13:13 -0600)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 24 Sep 2008 00:11:25 +0000 (17:11 -0700)
src/mesa/shader/slang/slang_link.c

index b780e87..dd7d5be 100644 (file)
@@ -381,6 +381,7 @@ static void
 _slang_update_inputs_outputs(struct gl_program *prog)
 {
    GLuint i, j;
+   GLuint maxAddrReg = 0;
 
    prog->InputsRead = 0x0;
    prog->OutputsWritten = 0x0;
@@ -406,11 +407,19 @@ _slang_update_inputs_outputs(struct gl_program *prog)
                   fp->UsesPointCoord = GL_TRUE;
             }
          }
+         else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) {
+            maxAddrReg = MAX2(maxAddrReg, inst->SrcReg[j].Index + 1);
+         }
       }
       if (inst->DstReg.File == PROGRAM_OUTPUT) {
          prog->OutputsWritten |= 1 << inst->DstReg.Index;
       }
+      else if (inst->DstReg.File == PROGRAM_ADDRESS) {
+         maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1);
+      }
    }
+
+   prog->NumAddressRegs = maxAddrReg;
 }