=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Pass structure byte stride to wined3d_buffer_create().

Alexandre Julliard julliard at winehq.org
Thu Feb 23 16:27:52 CST 2017


Module: wine
Branch: master
Commit: d867c6aa1ee5537a1412014248cad480351e48cc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d867c6aa1ee5537a1412014248cad480351e48cc

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Feb 23 15:00:56 2017 +0100

wined3d: Pass structure byte stride to wined3d_buffer_create().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/buffer.c    | 4 +---
 dlls/wined3d/buffer.c  | 8 +++-----
 include/wine/wined3d.h | 9 +++++----
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index af3ab39..8233742 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -444,9 +444,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
     wined3d_desc.bind_flags = buffer->desc.BindFlags;
     wined3d_desc.cpu_access_flags = buffer->desc.CPUAccessFlags;
     wined3d_desc.misc_flags = buffer->desc.MiscFlags;
-
-    if (buffer->desc.StructureByteStride)
-        FIXME("Ignoring structure byte stride %u.\n", buffer->desc.StructureByteStride);
+    wined3d_desc.structure_byte_stride = buffer->desc.StructureByteStride;
 
     wined3d_mutex_lock();
     wined3d_private_store_init(&buffer->private_store);
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 0c172d0..5ea7eff 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1467,15 +1467,13 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
     TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p.\n",
             device, desc, data, parent, parent_ops, buffer);
 
-    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
-    if (!object)
+    if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
         return E_OUTOFMEMORY;
 
     FIXME("Ignoring access flags (pool).\n");
 
-    hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
-            WINED3D_POOL_MANAGED, desc->bind_flags, data, parent, parent_ops);
-    if (FAILED(hr))
+    if (FAILED(hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
+            WINED3D_POOL_MANAGED, desc->bind_flags, data, parent, parent_ops)))
     {
         WARN("Failed to initialize buffer, hr %#x.\n", hr);
         HeapFree(GetProcessHeap(), 0, object);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 03f3db9..58e3f0d 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1916,11 +1916,12 @@ struct wined3d_blt_fx
 
 struct wined3d_buffer_desc
 {
-    UINT byte_width;
+    unsigned int byte_width;
     DWORD usage;
-    UINT bind_flags;
-    UINT cpu_access_flags;
-    UINT misc_flags;
+    unsigned int bind_flags;
+    unsigned int cpu_access_flags;
+    unsigned int misc_flags;
+    unsigned int structure_byte_stride;
 };
 
 struct wined3d_rasterizer_state_desc




More information about the wine-cvs mailing list