gallium: Cache one line worth of debug output on windows.
The windbg connection seems synchronous, so this speeds up when printing little text at a time (e.g., tgsi output).
This commit is contained in:
@@ -59,10 +59,15 @@ void _debug_vprintf(const char *format, va_list ap)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef WINCE
|
#ifndef WINCE
|
||||||
/* EngDebugPrint does not handle float point arguments, so we need to use
|
/* EngDebugPrint does not handle float point arguments, so we need to use
|
||||||
* our own vsnprintf implementation */
|
* our own vsnprintf implementation. It is also very slow, so buffer until
|
||||||
char buf[512 + 1];
|
* we find a newline. */
|
||||||
util_vsnprintf(buf, sizeof(buf), format, ap);
|
static char buf[512 + 1] = {'\0'};
|
||||||
|
size_t len = strlen(buf);
|
||||||
|
int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap);
|
||||||
|
if(ret > (int)(sizeof(buf) - len - 1) || strchr(buf + len, '\n')) {
|
||||||
_EngDebugPrint("%s", buf);
|
_EngDebugPrint("%s", buf);
|
||||||
|
buf[0] = '\0';
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* TODO: Implement debug print for WINCE */
|
/* TODO: Implement debug print for WINCE */
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user