summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_emit.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-02-23 10:19:55 -0700
committerBrian <[email protected]>2007-02-23 10:19:55 -0700
commit99902198de9a81fa95ab058048d618c5ecb7856e (patch)
tree6c9e495a1ff6a8b2a53829250be60fab7b2f74c2 /src/mesa/shader/slang/slang_emit.c
parent5186ae9bbe8c630c2434c7488fbe5bffdfba46a7 (diff)
comments, clean-up
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r--src/mesa/shader/slang/slang_emit.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 764b5f61385..e57f215dfe9 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -28,6 +28,14 @@
* \author Brian Paul
*/
+/***
+ *** NOTES
+ ***
+ *** To emit GPU instructions, we basically just do an in-order traversal
+ *** of the IR tree.
+ ***/
+
+
#include "imports.h"
#include "context.h"
#include "macros.h"
@@ -46,6 +54,7 @@
/* XXX temporarily here */
static GLboolean EmitHighLevelInstructions = GL_TRUE;
+static GLboolean EmitComments = GL_FALSE;
@@ -1415,9 +1424,8 @@ emit(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog)
*/
assert(n->Var->aux == n->Store);
}
-#ifdef DEBUG_foo
- /* emit NOP with comment describing the variable's storage location */
- {
+ if (EmitComments) {
+ /* emit NOP with comment describing the variable's storage location */
char s[1000];
sprintf(s, "TEMP[%d]%s = %s (size %d)",
n->Store->Index,
@@ -1428,9 +1436,7 @@ emit(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog)
inst->Comment = _mesa_strdup(s);
return inst;
}
-#else
return NULL;
-#endif
case IR_VAR:
/* Reference to a variable