d3d8 adapters are actually outputs in wined3d.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d8/d3d8_private.h | 4 +++- dlls/d3d8/device.c | 8 +++++--- dlls/d3d8/directx.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 488035c7f82..93526411767 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -51,7 +51,8 @@
extern const struct wined3d_parent_ops d3d8_null_wined3d_parent_ops DECLSPEC_HIDDEN;
-void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const struct wined3d_caps *wined3d_caps) DECLSPEC_HIDDEN; +void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const struct wined3d_caps *wined3d_caps, + unsigned int adapter_ordinal) DECLSPEC_HIDDEN;
struct d3d8 { @@ -113,6 +114,7 @@ struct d3d8_device struct wined3d_device_parent device_parent; LONG ref; struct wined3d_device *wined3d_device; + unsigned int adapter_ordinal; IDirect3D8 *d3d_parent; struct d3d8_handle_table handle_table;
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 4b7c03e4e42..400e1e292ab 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -310,10 +310,11 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch return TRUE; }
-void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const struct wined3d_caps *wined3d_caps) +void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const struct wined3d_caps *wined3d_caps, + unsigned int adapter_ordinal) { caps->DeviceType = (D3DDEVTYPE)wined3d_caps->DeviceType; - caps->AdapterOrdinal = wined3d_caps->AdapterOrdinal; + caps->AdapterOrdinal = adapter_ordinal; caps->Caps = wined3d_caps->Caps; caps->Caps2 = wined3d_caps->Caps2; caps->Caps3 = wined3d_caps->Caps3; @@ -689,7 +690,7 @@ static HRESULT WINAPI d3d8_device_GetDeviceCaps(IDirect3DDevice8 *iface, D3DCAPS hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps); wined3d_mutex_unlock();
- d3dcaps_from_wined3dcaps(caps, &wined3d_caps); + d3dcaps_from_wined3dcaps(caps, &wined3d_caps, device->adapter_ordinal);
return hr; } @@ -3678,6 +3679,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
device->IDirect3DDevice8_iface.lpVtbl = &d3d8_device_vtbl; device->device_parent.ops = &d3d8_wined3d_device_parent_ops; + device->adapter_ordinal = adapter; device->ref = 1; if (!(device->handle_table.entries = heap_alloc_zero(D3D8_INITIAL_HANDLE_TABLE_SIZE * sizeof(*device->handle_table.entries)))) diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 66e7e622f8f..343073f3515 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -389,7 +389,7 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); wined3d_mutex_unlock();
- d3dcaps_from_wined3dcaps(caps, &wined3d_caps); + d3dcaps_from_wined3dcaps(caps, &wined3d_caps, adapter);
return hr; }