Commit 7c2e91c5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Fix debug_d3dusage() to handle combinations of flags.

parent f3473744
...@@ -911,9 +911,12 @@ const char* debug_d3ddevicetype(WINED3DDEVTYPE devtype) { ...@@ -911,9 +911,12 @@ const char* debug_d3ddevicetype(WINED3DDEVTYPE devtype) {
} }
} }
const char* debug_d3dusage(DWORD usage) { const char *debug_d3dusage(DWORD usage)
switch (usage & WINED3DUSAGE_MASK) { {
#define WINED3DUSAGE_TO_STR(u) case u: return #u char buf[284];
buf[0] = '\0';
#define WINED3DUSAGE_TO_STR(u) if (usage & u) { strcat(buf, " | "#u); usage &= ~u; }
WINED3DUSAGE_TO_STR(WINED3DUSAGE_RENDERTARGET); WINED3DUSAGE_TO_STR(WINED3DUSAGE_RENDERTARGET);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_DEPTHSTENCIL); WINED3DUSAGE_TO_STR(WINED3DUSAGE_DEPTHSTENCIL);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_WRITEONLY); WINED3DUSAGE_TO_STR(WINED3DUSAGE_WRITEONLY);
...@@ -926,11 +929,9 @@ const char* debug_d3dusage(DWORD usage) { ...@@ -926,11 +929,9 @@ const char* debug_d3dusage(DWORD usage) {
WINED3DUSAGE_TO_STR(WINED3DUSAGE_AUTOGENMIPMAP); WINED3DUSAGE_TO_STR(WINED3DUSAGE_AUTOGENMIPMAP);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_DMAP); WINED3DUSAGE_TO_STR(WINED3DUSAGE_DMAP);
#undef WINED3DUSAGE_TO_STR #undef WINED3DUSAGE_TO_STR
case 0: return "none"; if (usage) FIXME("Unrecognized usage flag(s) %#x\n", usage);
default:
FIXME("Unrecognized %u Usage!\n", usage); return buf[0] ? wine_dbg_sprintf("%s", &buf[3]) : "0";
return "unrecognized";
}
} }
const char* debug_d3dusagequery(DWORD usagequery) { const char* debug_d3dusagequery(DWORD usagequery) {
......
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