summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_execute.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-19 20:12:32 +0000
committerBrian Paul <[email protected]>2005-09-19 20:12:32 +0000
commitb3aefd1cfb6aacd1695c52911dd39da50d893ece (patch)
tree247125551b41cc22dec6f1f03bb1d6709c804bba /src/mesa/shader/slang/slang_execute.c
parenta01cb26a90aaa8f631c94d741617715dff89168c (diff)
additional wrapper updates, bug 4468
Diffstat (limited to 'src/mesa/shader/slang/slang_execute.c')
-rw-r--r--src/mesa/shader/slang/slang_execute.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c
index 78a638b4445..5b1d6d39409 100644
--- a/src/mesa/shader/slang/slang_execute.c
+++ b/src/mesa/shader/slang/slang_execute.c
@@ -34,6 +34,9 @@
#include "slang_storage.h"
#include "slang_execute.h"
+#define DEBUG_SLANG
+
+#ifdef DEBUG_SLANG
static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
{
fprintf (f, "%.5u:\t", i);
@@ -179,11 +182,14 @@ static void dump (const slang_assembly_file *file)
fclose (f);
}
+#endif
int _slang_execute (const slang_assembly_file *file)
{
slang_machine mach;
+#ifdef DEBUG_SLANG
FILE *f;
+#endif
mach.ip = 0;
mach.sp = SLANG_MACHINE_STACK_SIZE;
@@ -200,13 +206,18 @@ int _slang_execute (const slang_assembly_file *file)
static_assert(sizeof (GLuint) == 4);
/*static_assert(sizeof (GLuint *) == 4);*/
+#ifdef DEBUG_SLANG
dump (file);
+#endif
+#ifdef DEBUG_SLANG
f = fopen ("~mesa-slang-assembly-execution.txt", "w");
+#endif
while (!mach.exit)
{
slang_assembly *a = file->code + mach.ip;
+#ifdef DEBUG_SLANG
if (f != NULL)
{
unsigned int i;
@@ -216,6 +227,7 @@ int _slang_execute (const slang_assembly_file *file)
fprintf (f, "\t%.5u\t%6f\t%u\n", i, mach.stack._float[i], mach.stack._addr[i]);
fflush (f);
}
+#endif
mach.ip++;
switch (a->type)
@@ -344,8 +356,10 @@ int _slang_execute (const slang_assembly_file *file)
}
}
+#ifdef DEBUG_SLANG
if (f != NULL)
fclose (f);
+#endif
return 0;
}