summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_emit.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-20 13:44:43 -0700
committerBrian Paul <[email protected]>2009-02-20 13:44:43 -0700
commit0ea95ae7420b4217b5c10c7593eb2e08e971bf72 (patch)
treeef9c5bf4a9743ebb5dd82d3408b6050635e52f29 /src/mesa/shader/slang/slang_emit.c
parent44e018c09e7aeba9fd9f4c380da224bd6622c470 (diff)
glsl: use new IR opcodes for TEX instructions with shadow comparison
Such TEX instructions will have the TexShadow flag set. The gl_program::ShadowSamplers field is now set in the linker. We missed that before.
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r--src/mesa/shader/slang/slang_emit.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index feff1b7474d..c9d008c0af8 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1261,16 +1261,33 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n)
{
struct prog_instruction *inst;
gl_inst_opcode opcode;
+ GLboolean shadow = GL_FALSE;
- if (n->Opcode == IR_TEX) {
+ switch (n->Opcode) {
+ case IR_TEX:
opcode = OPCODE_TEX;
- }
- else if (n->Opcode == IR_TEXB) {
+ break;
+ case IR_TEX_SH:
+ opcode = OPCODE_TEX;
+ shadow = GL_TRUE;
+ break;
+ case IR_TEXB:
opcode = OPCODE_TXB;
- }
- else {
- assert(n->Opcode == IR_TEXP);
+ break;
+ case IR_TEXB_SH:
+ opcode = OPCODE_TXB;
+ shadow = GL_TRUE;
+ break;
+ case IR_TEXP:
+ opcode = OPCODE_TXP;
+ break;
+ case IR_TEXP_SH:
opcode = OPCODE_TXP;
+ shadow = GL_TRUE;
+ break;
+ default:
+ _mesa_problem(NULL, "Bad IR TEX code");
+ return NULL;
}
if (n->Children[0]->Opcode == IR_ELEMENT) {
@@ -1302,6 +1319,8 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n)
NULL,
NULL);
+ inst->TexShadow = shadow;
+
/* Store->Index is the uniform/sampler index */
assert(n->Children[0]->Store->Index >= 0);
inst->TexSrcUnit = n->Children[0]->Store->Index;
@@ -2270,6 +2289,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
case IR_TEX:
case IR_TEXB:
case IR_TEXP:
+ case IR_TEX_SH:
+ case IR_TEXB_SH:
+ case IR_TEXP_SH:
return emit_tex(emitInfo, n);
case IR_NEG:
return emit_negation(emitInfo, n);