Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/utils.c | 25 +++++++++++++++++++++++++ dlls/wined3d/view.c | 12 ++++++------ dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index d62578bf9f..da01bbb0b6 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index b8a3568d7e..3662250538 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -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; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dbab1aaf76..c3761860b0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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) {