wined3d: Try harder to print something reasonable in wined3d_debug_location().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7c18fe17c7
commit
19bb2b1b7e
|
@ -5456,8 +5456,17 @@ void wined3d_get_draw_rect(const struct wined3d_state *state, RECT *rect)
|
|||
|
||||
const char *wined3d_debug_location(DWORD location)
|
||||
{
|
||||
const char *prefix = "";
|
||||
const char *suffix = "";
|
||||
char buf[294];
|
||||
|
||||
if (wined3d_popcount(location) > 16)
|
||||
{
|
||||
prefix = "~(";
|
||||
location = ~location;
|
||||
suffix = ")";
|
||||
}
|
||||
|
||||
buf[0] = '\0';
|
||||
#define LOCATION_TO_STR(u) if (location & u) { strcat(buf, " | "#u); location &= ~u; }
|
||||
LOCATION_TO_STR(WINED3D_LOCATION_DISCARDED);
|
||||
|
@ -5472,7 +5481,7 @@ const char *wined3d_debug_location(DWORD location)
|
|||
#undef LOCATION_TO_STR
|
||||
if (location) FIXME("Unrecognized location flag(s) %#x.\n", location);
|
||||
|
||||
return buf[0] ? wine_dbg_sprintf("%s", &buf[3]) : "0";
|
||||
return wine_dbg_sprintf("%s%s%s", prefix, buf[0] ? &buf[3] : "0", suffix);
|
||||
}
|
||||
|
||||
/* Print a floating point value with the %.8e format specifier, always using
|
||||
|
|
Loading…
Reference in New Issue