Commit 19bb2b1b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Try harder to print something reasonable in wined3d_debug_location().

parent 7c18fe17
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment