X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Ftgsi%2Ftgsi_ureg.c;h=55ed7fc62b44badeaa9950a0a39e85ec63f64c1e;hb=c9af7701d1be791752fafcbe19169851bcdf1336;hp=92c98c763eb552ebdf8d00107fb2ecac064150b6;hpb=4f51e8880d1c0ba072f9f7a10f955ad79c30e991;p=mesa.git diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 92c98c763eb..55ed7fc62b4 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -1241,7 +1241,7 @@ static void validate( enum tgsi_opcode opcode, unsigned nr_dst, unsigned nr_src ) { -#ifdef DEBUG +#ifndef NDEBUG const struct tgsi_opcode_info *info = tgsi_get_opcode_info( opcode ); assert(info); if (info) { @@ -2106,7 +2106,18 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg ) } #if DEBUG - if (tokens && !tgsi_sanity_check(tokens)) { + /* tgsi_sanity doesn't seem to return if there are too many constants. */ + bool too_many_constants = false; + for (unsigned i = 0; i < ARRAY_SIZE(ureg->const_decls); i++) { + for (unsigned j = 0; j < ureg->const_decls[i].nr_constant_ranges; j++) { + if (ureg->const_decls[i].constant_range[j].last > 4096) { + too_many_constants = true; + break; + } + } + } + + if (tokens && !too_many_constants && !tgsi_sanity_check(tokens)) { debug_printf("tgsi_ureg.c, sanity check failed on generated tokens:\n"); tgsi_dump(tokens, 0); assert(0);