Commit c7568a57 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Dump view descriptor contents.

parent 097c4b13
......@@ -4468,6 +4468,31 @@ const char *wined3d_debug_bind_flags(DWORD bind_flags)
return wine_dbg_sprintf("%s", buffer.str);
}
const char *wined3d_debug_view_desc(const struct wined3d_view_desc *d, const struct wined3d_resource *resource)
{
struct debug_buffer buffer;
unsigned int flags = d->flags;
init_debug_buffer(&buffer, "0");
#define VIEW_FLAG_TO_STR(x) if (flags & x) { debug_append(&buffer, #x, " | "); flags &= ~x; }
VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_RAW);
VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_APPEND);
VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_COUNTER);
VIEW_FLAG_TO_STR(WINED3D_VIEW_TEXTURE_CUBE);
VIEW_FLAG_TO_STR(WINED3D_VIEW_TEXTURE_ARRAY);
#undef VIEW_FLAG_TO_STR
if (flags)
FIXME("Unrecognised view flag(s) %#x.\n", flags);
if (resource->type == WINED3D_RTYPE_BUFFER)
return wine_dbg_sprintf("format %s, flags %s, start_idx %u, count %u",
debug_d3dformat(d->format_id), buffer.str, d->u.buffer.start_idx, d->u.buffer.count);
else
return wine_dbg_sprintf("format %s, flags %s, level_idx %u, level_count %u, layer_idx %u, layer_count %u",
debug_d3dformat(d->format_id), buffer.str, d->u.texture.level_idx, d->u.texture.level_count,
d->u.texture.layer_idx, d->u.texture.layer_count);
}
const char *debug_d3dusage(DWORD usage)
{
struct debug_buffer buffer;
......
......@@ -620,8 +620,8 @@ HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_view_desc *d
struct wined3d_rendertarget_view *object;
HRESULT hr;
TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
desc, resource, parent, parent_ops, view);
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -799,8 +799,8 @@ HRESULT CDECL wined3d_shader_resource_view_create(const struct wined3d_view_desc
struct wined3d_shader_resource_view *object;
HRESULT hr;
TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
desc, resource, parent, parent_ops, view);
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -1167,8 +1167,8 @@ HRESULT CDECL wined3d_unordered_access_view_create(const struct wined3d_view_des
struct wined3d_unordered_access_view *object;
HRESULT hr;
TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
desc, resource, parent, parent_ops, view);
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......
......@@ -3065,6 +3065,8 @@ 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;
const char *wined3d_debug_view_desc(const struct wined3d_view_desc *d,
const struct wined3d_resource *resource) DECLSPEC_HIDDEN;
static inline BOOL wined3d_resource_access_is_managed(unsigned int access)
{
......
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