wined3d: Dump buffer descriptor in wined3d_buffer_create().

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2018-10-12 15:39:53 +02:00 committed by Alexandre Julliard
parent c494570d89
commit 097c4b135b
3 changed files with 27 additions and 2 deletions

View File

@ -1445,8 +1445,11 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
struct wined3d_buffer *object;
HRESULT hr;
TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p.\n",
device, desc, data, parent, parent_ops, buffer);
TRACE("device %p, desc byte_width %u, usage %s, bind_flags %s, access %s, data %p, parent %p, "
"parent_ops %p, buffer %p.\n",
device, desc->byte_width, debug_d3dusage(desc->usage),
wined3d_debug_bind_flags(desc->bind_flags), wined3d_debug_resource_access(desc->access),
data, parent, parent_ops, buffer);
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;

View File

@ -4447,6 +4447,27 @@ const char *wined3d_debug_resource_access(DWORD access)
return wine_dbg_sprintf("%s", buffer.str);
}
const char *wined3d_debug_bind_flags(DWORD bind_flags)
{
struct debug_buffer buffer;
init_debug_buffer(&buffer, "0");
#define BIND_FLAG_TO_STR(x) if (bind_flags & x) { debug_append(&buffer, #x, " | "); bind_flags &= ~x; }
BIND_FLAG_TO_STR(WINED3D_BIND_VERTEX_BUFFER);
BIND_FLAG_TO_STR(WINED3D_BIND_INDEX_BUFFER);
BIND_FLAG_TO_STR(WINED3D_BIND_CONSTANT_BUFFER);
BIND_FLAG_TO_STR(WINED3D_BIND_SHADER_RESOURCE);
BIND_FLAG_TO_STR(WINED3D_BIND_STREAM_OUTPUT);
BIND_FLAG_TO_STR(WINED3D_BIND_RENDER_TARGET);
BIND_FLAG_TO_STR(WINED3D_BIND_DEPTH_STENCIL);
BIND_FLAG_TO_STR(WINED3D_BIND_UNORDERED_ACCESS);
#undef BIND_FLAG_TO_STR
if (bind_flags)
FIXME("Unrecognised bind flag(s) %#x.\n", bind_flags);
return wine_dbg_sprintf("%s", buffer.str);
}
const char *debug_d3dusage(DWORD usage)
{
struct debug_buffer buffer;

View File

@ -3064,6 +3064,7 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD sta
}
const char *wined3d_debug_resource_access(DWORD access) DECLSPEC_HIDDEN;
const char *wined3d_debug_bind_flags(DWORD bind_flags) DECLSPEC_HIDDEN;
static inline BOOL wined3d_resource_access_is_managed(unsigned int access)
{