diff options
author | Brian <[email protected]> | 2007-02-22 17:46:20 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-22 17:46:20 -0700 |
commit | 0cc941963197fcdf8913462dbb225bc2bfca9d85 (patch) | |
tree | c162ef52912c554a0353a0bc5b22b8054abe78f5 /src/mesa | |
parent | 059376c855cbeb160e98f438a35edb8bd88b8bb2 (diff) |
debug code for emitting variable allocation comments
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 8ea54412edc..76b03753b6a 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1410,7 +1410,22 @@ emit(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog) */ assert(n->Var->aux == n->Store); } - break; +#ifdef DEBUG_foo + /* emit NOP with comment describing the variable's storage location */ + { + char s[1000]; + sprintf(s, "TEMP[%d]%s = %s (size %d)", + n->Store->Index, + _mesa_swizzle_string(n->Store->Swizzle, 0, GL_FALSE), + (char *) n->Var->a_name, + n->Store->Size); + inst = new_instruction(prog, OPCODE_NOP); + inst->Comment = _mesa_strdup(s); + return inst; + } +#else + return NULL; +#endif case IR_VAR: /* Reference to a variable |