diff options
author | Brian Paul <brianp@vmware.com> | 2010-07-30 14:24:23 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-07-30 14:29:19 -0600 |
commit | 56643096f1eb01eefa1a532ac096b32d23b6b8ba (patch) | |
tree | 0ba325dd7148936ca0e6bce0b2f3fae3bd6e68be /src/mesa/slang/slang_link.c | |
parent | 79ab5b9798c911e7612e26616df82e98372549bf (diff) |
mesa: added gl_program::IndirectRegisterFiles field
Now drivers, etc. can know which register files are accessed with
indirect addressing. Before we just checked gl_program::NumAddressRegs
but didn't know if that was the constant buffer, temp regs, or what.
The only user of this new field so far will be the gallium state tracker.
Diffstat (limited to 'src/mesa/slang/slang_link.c')
-rw-r--r-- | src/mesa/slang/slang_link.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/slang/slang_link.c b/src/mesa/slang/slang_link.c index 00c2c13cc6..94db6f918d 100644 --- a/src/mesa/slang/slang_link.c +++ b/src/mesa/slang/slang_link.c @@ -756,6 +756,8 @@ _slang_update_inputs_outputs(struct gl_program *prog) prog->InputsRead = 0x0; prog->OutputsWritten = 0x0; + prog->IndirectRegisterFiles = 0x0; + for (i = 0; i < prog->NumInstructions; i++) { const struct prog_instruction *inst = prog->Instructions + i; const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); @@ -774,6 +776,9 @@ _slang_update_inputs_outputs(struct gl_program *prog) else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) { maxAddrReg = MAX2(maxAddrReg, (GLuint) (inst->SrcReg[j].Index + 1)); } + + if (inst->SrcReg[j].RelAddr) + prog->IndirectRegisterFiles |= (1 << inst->SrcReg[j].File); } if (inst->DstReg.File == PROGRAM_OUTPUT) { @@ -784,6 +789,8 @@ _slang_update_inputs_outputs(struct gl_program *prog) else if (inst->DstReg.File == PROGRAM_ADDRESS) { maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1); } + if (inst->DstReg.RelAddr) + prog->IndirectRegisterFiles |= (1 << inst->DstReg.File); } prog->NumAddressRegs = maxAddrReg; } |