Henri Verbeet : wined3d: Explicitly set surface alignment in the client libs.

Alexandre Julliard julliard at winehq.org
Fri Jun 24 13:53:59 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Jun 23 11:43:39 2011 +0200

wined3d: Explicitly set surface alignment in the client libs.

Instead of using dxVersion.

---

 dlls/d3d8/device.c             |    2 +-
 dlls/d3d9/device.c             |    2 +-
 dlls/ddraw/ddraw.c             |    2 +-
 dlls/dxgi/device.c             |    2 +-
 dlls/wined3d/device.c          |    5 ++---
 dlls/wined3d/directx.c         |    6 ++++--
 dlls/wined3d/wined3d.spec      |    2 +-
 dlls/wined3d/wined3d_private.h |    2 +-
 include/wine/wined3d.h         |    2 +-
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 902c56b..ebab791 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -3100,7 +3100,7 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IDirect3D8Impl *parent, struct
     if (!(flags & D3DCREATE_FPU_PRESERVE)) setup_fpu();
 
     wined3d_mutex_lock();
-    hr = wined3d_device_create(wined3d, adapter, device_type, focus_window, flags,
+    hr = wined3d_device_create(wined3d, adapter, device_type, focus_window, flags, 4,
             &device->device_parent, &device->wined3d_device);
     if (FAILED(hr))
     {
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 2e4ca5d..5aa324e 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -3348,7 +3348,7 @@ HRESULT device_init(IDirect3DDevice9Impl *device, IDirect3D9Impl *parent, struct
     if (!(flags & D3DCREATE_FPU_PRESERVE)) setup_fpu();
 
     wined3d_mutex_lock();
-    hr = wined3d_device_create(wined3d, adapter, device_type, focus_window, flags,
+    hr = wined3d_device_create(wined3d, adapter, device_type, focus_window, flags, 4,
             &device->device_parent, &device->wined3d_device);
     if (FAILED(hr))
     {
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index ca91b45..7014ee8 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -6042,7 +6042,7 @@ HRESULT ddraw_init(IDirectDrawImpl *ddraw, WINED3DDEVTYPE device_type)
     }
 
     hr = wined3d_device_create(ddraw->wineD3D, WINED3DADAPTER_DEFAULT, device_type,
-            NULL, 0, &ddraw->device_parent, &ddraw->wined3d_device);
+            NULL, 0, 8, &ddraw->device_parent, &ddraw->wined3d_device);
     if (FAILED(hr))
     {
         WARN("Failed to create a wined3d device, hr %#x.\n", hr);
diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c
index f7ad811..9c94434 100644
--- a/dlls/dxgi/device.c
+++ b/dlls/dxgi/device.c
@@ -399,7 +399,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
 
     FIXME("Ignoring adapter type.\n");
     EnterCriticalSection(&dxgi_cs);
-    hr = wined3d_device_create(wined3d, adapter_ordinal, WINED3DDEVTYPE_HAL, NULL, 0,
+    hr = wined3d_device_create(wined3d, adapter_ordinal, WINED3DDEVTYPE_HAL, NULL, 0, 4,
             wined3d_device_parent, &device->wined3d_device);
     IWineDXGIDeviceParent_Release(dxgi_device_parent);
     wined3d_decref(wined3d);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 20e9508..6314372 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6102,7 +6102,7 @@ HRESULT CDECL wined3d_device_get_surface_from_dc(struct wined3d_device *device,
 
 HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
         UINT adapter_idx, WINED3DDEVTYPE device_type, HWND focus_window, DWORD flags,
-        struct wined3d_device_parent *device_parent)
+        BYTE surface_alignment, struct wined3d_device_parent *device_parent)
 {
     struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
     const struct fragment_pipeline *fragment_pipeline;
@@ -6119,8 +6119,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
     device->device_parent = device_parent;
     list_init(&device->resources);
     list_init(&device->shaders);
-
-    device->surface_alignment = wined3d->dxVersion == 7 ? DDRAW_PITCH_ALIGNMENT : D3D8_PITCH_ALIGNMENT;
+    device->surface_alignment = surface_alignment;
 
     /* Get the initial screen setup for ddraw. */
     hr = wined3d_get_adapter_display_mode(wined3d, adapter_idx, &mode);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 34eea82..ceaef32 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4841,7 +4841,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
 }
 
 HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, WINED3DDEVTYPE device_type,
-        HWND focus_window, DWORD flags, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
+        HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent,
+        struct wined3d_device **device)
 {
     struct wined3d_device *object;
     HRESULT hr;
@@ -4861,7 +4862,8 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, W
         return E_OUTOFMEMORY;
     }
 
-    hr = device_init(object, wined3d, adapter_idx, device_type, focus_window, flags, device_parent);
+    hr = device_init(object, wined3d, adapter_idx, device_type,
+            focus_window, flags, surface_alignment, device_parent);
     if (FAILED(hr))
     {
         WARN("Failed to initialize device, hr %#x.\n", hr);
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 4483ba8..2cbd57c 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -47,7 +47,7 @@
 @ cdecl wined3d_device_clear(ptr long ptr long long float long)
 @ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr)
 @ cdecl wined3d_device_color_fill(ptr ptr ptr ptr)
-@ cdecl wined3d_device_create(ptr long long ptr long ptr ptr)
+@ cdecl wined3d_device_create(ptr long long ptr long long ptr ptr)
 @ cdecl wined3d_device_decref(ptr)
 @ cdecl wined3d_device_delete_patch(ptr long)
 @ cdecl wined3d_device_draw_indexed_primitive(ptr long long)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ebe627f..cc75cde 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1791,7 +1791,7 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
 void device_get_draw_rect(struct wined3d_device *device, RECT *rect) DECLSPEC_HIDDEN;
 HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
         UINT adapter_idx, WINED3DDEVTYPE device_type, HWND focus_window, DWORD flags,
-        struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN;
+        BYTE surface_alignment, struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN;
 void device_preload_textures(struct wined3d_device *device) DECLSPEC_HIDDEN;
 LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL unicode,
         UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 99dcc37..0065441 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2179,7 +2179,7 @@ void __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *devic
 HRESULT __cdecl wined3d_device_color_fill(struct wined3d_device *device, struct wined3d_surface *surface,
         const RECT *rect, const WINED3DCOLORVALUE *color);
 HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,
-        WINED3DDEVTYPE device_type, HWND focus_window, DWORD behaviour_flags,
+        WINED3DDEVTYPE device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment,
         struct wined3d_device_parent *device_parent, struct wined3d_device **device);
 ULONG __cdecl wined3d_device_decref(struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_delete_patch(struct wined3d_device *device, UINT handle);




More information about the wine-cvs mailing list