From: Michal Krol Date: Mon, 18 Aug 2008 20:21:32 +0000 (+0200) Subject: tgsi: Workaround debug output buffer size limitations. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b512c0135bc8512cc80009ea7430f7cc0c869d6;p=mesa.git tgsi: Workaround debug output buffer size limitations. --- diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index 4309d1bc76f..a168c949280 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -518,8 +518,23 @@ tgsi_dump( uint flags ) { static char str[4096]; - + uint len; + char *p = str; + tgsi_dump_str(tokens, flags, str, sizeof(str)); - - debug_printf("%s", str); + + /* Workaround output buffer size limitations. + */ + len = strlen( str ); + while (len > 256) { + char piggy_bank; + + piggy_bank = p[256]; + p[256] = '\0'; + debug_printf( "%s", p ); + p[256] = piggy_bank; + p += 256; + len -= 256; + } + debug_printf( "%s", p ); }