Henri Verbeet : wined3d: Try harder to print something reasonable in wined3d_debug_location().
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Apr 22 09:55:13 CDT 2016
Module: wine
Branch: master
Commit: 19bb2b1b7e350dc0180ddff4efbfea2b1fdd63de
URL: http://source.winehq.org/git/wine.git/?a=commit;h=19bb2b1b7e350dc0180ddff4efbfea2b1fdd63de
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Apr 21 17:05:03 2016 +0200
wined3d: Try harder to print something reasonable in wined3d_debug_location().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/utils.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index c0688b5..2eca094 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -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
More information about the wine-cvs
mailing list