summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-01-04 17:43:53 -0700
committerBrian <brian@yutani.localnet.net>2007-01-04 17:43:53 -0700
commit4428e8f20f8b6f5db086d8bd8b68ea3da9e9b0f0 (patch)
treea4c9a6f5aa33e005a79cde89e24b80e4c1b53450 /src/mesa/shader
parent64f78dd6a8596700a3cb5e657164775ebbc2e8db (diff)
update TexturesUsed[] in slang_update_inputs_outputs()
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/slang_link2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_link2.c b/src/mesa/shader/slang/slang_link2.c
index f68eaca167..33813fecc4 100644
--- a/src/mesa/shader/slang/slang_link2.c
+++ b/src/mesa/shader/slang/slang_link2.c
@@ -296,6 +296,7 @@ slang_resolve_branches(struct gl_program *prog)
/**
* Scan program instructions to update the program's InputsRead and
* OutputsWritten fields.
+ * Also, update the program's TexturesUsed[] array.
*/
static void
slang_update_inputs_outputs(struct gl_program *prog)
@@ -305,6 +306,9 @@ slang_update_inputs_outputs(struct gl_program *prog)
prog->InputsRead = 0x0;
prog->OutputsWritten = 0x0;
+ for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
+ prog->TexturesUsed[i] = 0;
+
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);
@@ -316,6 +320,12 @@ slang_update_inputs_outputs(struct gl_program *prog)
if (inst->DstReg.File == PROGRAM_OUTPUT) {
prog->OutputsWritten |= 1 << inst->DstReg.Index;
}
+
+ if (inst->Opcode == OPCODE_TEX ||
+ inst->Opcode == OPCODE_TXB ||
+ inst->Opcode == OPCODE_TXP) {
+ prog->TexturesUsed[inst->TexSrcUnit] |= (1 << inst->TexSrcTarget);
+ }
}
}