Matteo Bruni : wined3d: Dump buffer descriptor in wined3d_buffer_create().

Alexandre Julliard julliard at winehq.org
Fri Oct 12 18:00:41 CDT 2018


Module: wine
Branch: master
Commit: 097c4b135bf9dd409a17d3ec667c8c8cbb690589
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=097c4b135bf9dd409a17d3ec667c8c8cbb690589

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Oct 12 15:39:53 2018 +0200

wined3d: Dump buffer descriptor in wined3d_buffer_create().

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/buffer.c          |  7 +++++--
 dlls/wined3d/utils.c           | 21 +++++++++++++++++++++
 dlls/wined3d/wined3d_private.h |  1 +
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index e20d66c..e7b0515 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -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;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index e3df24a..d62578b 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -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;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 19945cf..dbab1aa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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)
 {




More information about the wine-cvs mailing list