summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@tungstengraphics.com>2008-09-16 16:17:46 +0200
committerJakob Bornecrantz <jakob@tungstengraphics.com>2008-09-16 16:20:19 +0200
commit358aab12c60d5e627d2ce54c1407659cbc207e8c (patch)
tree4eabef2a47b5bc13d59fe6abe0613fa9cfaf097e
parentad16ecbbe4fe8c1bcb18ed8fbbd672c68a0b17fa (diff)
mesa: State tracker now checks for faulty shaders on debug
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 5ec9fddd7..e822c8ac6 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -35,10 +35,12 @@
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_build.h"
#include "tgsi/tgsi_util.h"
+#include "tgsi/tgsi_dump.h"
+#include "tgsi/tgsi_sanity.h"
#include "st_mesa_to_tgsi.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
-
+#include "pipe/p_debug.h"
/*
* Map mesa register file to TGSI register file.
@@ -980,5 +982,14 @@ tgsi_translate_mesa_program(
maxTokens - ti );
}
+#if DEBUG
+ if(!tgsi_sanity_check(tokens)) {
+ //debug_printf("Due to sanity check failure the following shader program is invalid\n");
+ tgsi_dump(tokens, 0);
+
+ assert(0);
+ }
+#endif
+
return ti;
}