summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-08-18 22:21:32 +0200
committerMichal Krol <michal@tungstengraphics.com>2008-08-19 00:44:11 +0200
commit2b512c0135bc8512cc80009ea7430f7cc0c869d6 (patch)
tree7ab9978a44a63be68797faaa8b23e2f97a8d3fb1 /src/gallium
parent5b16730df8e19792ed92441857f586e0ec773a1f (diff)
tgsi: Workaround debug output buffer size limitations.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump.c21
1 files changed, 18 insertions, 3 deletions
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 );
}