wined3d: Explicitly set surface alignment in the client libs.

Instead of using dxVersion.
This commit is contained in:
Henri Verbeet 2011-06-23 11:43:39 +02:00 committed by Alexandre Julliard
parent fd8dbf0847
commit b296f181dd
9 changed files with 13 additions and 12 deletions

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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);