diff options
author | Alan Hourihane <[email protected]> | 2009-01-13 23:54:46 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2009-01-14 00:12:33 +0000 |
commit | ef0e0f2550b8bc63972ee53a80578b19ff2a5bbc (patch) | |
tree | d8150daf92ef2d68b25e24d15bdb4c74c7b62d8c /src/mesa/shader/slang/slang_emit.c | |
parent | 34d17d2bdc3da2fe8b669adc166f3ee07ad11391 (diff) |
glsl: support sampler arrays.
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index d3b4e64b78d..08b7d519a57 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1271,6 +1271,20 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) opcode = OPCODE_TXP; } + if (n->Children[0]->Opcode == IR_ELEMENT) { + /* array is the sampler (a uniform which'll indicate the texture unit) */ + assert(n->Children[0]->Children[0]->Store); + assert(n->Children[0]->Children[0]->Store->File == PROGRAM_SAMPLER); + + emit(emitInfo, n->Children[0]); + + n->Children[0]->Var = n->Children[0]->Children[0]->Var; + } else { + /* this is the sampler (a uniform which'll indicate the texture unit) */ + assert(n->Children[0]->Store); + assert(n->Children[0]->Store->File == PROGRAM_SAMPLER); + } + /* emit code for the texcoord operand */ (void) emit(emitInfo, n->Children[1]); @@ -1286,9 +1300,6 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) NULL, NULL); - /* Child[0] is the sampler (a uniform which'll indicate the texture unit) */ - assert(n->Children[0]->Store); - assert(n->Children[0]->Store->File == PROGRAM_SAMPLER); /* Store->Index is the sampler index */ assert(n->Children[0]->Store->Index >= 0); /* Store->Size is the texture target */ |