From: Keith Whitwell Date: Sat, 12 Sep 2009 21:05:37 +0000 (-0700) Subject: tgsi: sanity check ureg programs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e90fb86ac3f3a000c91d2cd9fab2bf27d4ede0e7;p=mesa.git tgsi: sanity check ureg programs --- diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index f7096bd8e2c..0780e2e0635 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -31,6 +31,7 @@ #include "tgsi/tgsi_ureg.h" #include "tgsi/tgsi_info.h" #include "tgsi/tgsi_dump.h" +#include "tgsi/tgsi_sanity.h" #include "util/u_memory.h" #include "util/u_math.h" @@ -890,6 +891,15 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg ) ureg->domain[DOMAIN_DECL].count); tgsi_dump( tokens, 0 ); } + +#if DEBUG + if (tokens && !tgsi_sanity_check(tokens)) { + debug_printf("tgsi_ureg.c, sanity check failed on generated tokens:\n"); + tgsi_dump(tokens, 0); + assert(0); + } +#endif + return tokens; }