mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 02:52:58 +00:00
[DXGI] Sync with Wine Staging 1.7.37. CORE-9246
svn path=/trunk/; revision=66531
This commit is contained in:
parent
db128b9633
commit
9667e8c3ef
9 changed files with 226 additions and 42 deletions
|
@ -66,6 +66,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
{
|
{
|
||||||
IDXGIOutput_Release(adapter->output);
|
IDXGIOutput_Release(adapter->output);
|
||||||
|
wined3d_private_store_cleanup(&adapter->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, adapter);
|
HeapFree(GetProcessHeap(), 0, adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,25 +76,31 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&adapter->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1 *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&adapter->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter1 *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&adapter->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, REFIID iid, void **parent)
|
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, REFIID iid, void **parent)
|
||||||
|
@ -225,11 +232,12 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *par
|
||||||
adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl;
|
adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl;
|
||||||
adapter->parent = parent;
|
adapter->parent = parent;
|
||||||
adapter->refcount = 1;
|
adapter->refcount = 1;
|
||||||
|
wined3d_private_store_init(&adapter->private_store);
|
||||||
adapter->ordinal = ordinal;
|
adapter->ordinal = ordinal;
|
||||||
|
|
||||||
output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output));
|
if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output))))
|
||||||
if (!output)
|
|
||||||
{
|
{
|
||||||
|
wined3d_private_store_cleanup(&adapter->private_store);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
dxgi_output_init(output, adapter);
|
dxgi_output_init(output, adapter);
|
||||||
|
|
|
@ -79,6 +79,7 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
|
||||||
wined3d_device_decref(This->wined3d_device);
|
wined3d_device_decref(This->wined3d_device);
|
||||||
LeaveCriticalSection(&dxgi_cs);
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
IDXGIFactory1_Release(This->factory);
|
IDXGIFactory1_Release(This->factory);
|
||||||
|
wined3d_private_store_cleanup(&This->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,25 +91,31 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IWineDXGIDevice *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IWineDXGIDevice *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&device->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDevice *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDevice *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&device->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IWineDXGIDevice *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IWineDXGIDevice *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&device->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, REFIID riid, void **parent)
|
static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, REFIID riid, void **parent)
|
||||||
|
@ -321,7 +328,7 @@ static const struct IWineDXGIDeviceVtbl dxgi_device_vtbl =
|
||||||
dxgi_device_QueryResourceResidency,
|
dxgi_device_QueryResourceResidency,
|
||||||
dxgi_device_SetGPUThreadPriority,
|
dxgi_device_SetGPUThreadPriority,
|
||||||
dxgi_device_GetGPUThreadPriority,
|
dxgi_device_GetGPUThreadPriority,
|
||||||
/* IWineDXGIAdapter methods */
|
/* IWineDXGIDevice methods */
|
||||||
dxgi_device_create_surface,
|
dxgi_device_create_surface,
|
||||||
dxgi_device_create_swapchain,
|
dxgi_device_create_swapchain,
|
||||||
};
|
};
|
||||||
|
@ -352,6 +359,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
|
|
||||||
device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl;
|
device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl;
|
||||||
device->refcount = 1;
|
device->refcount = 1;
|
||||||
|
wined3d_private_store_init(&device->private_store);
|
||||||
|
|
||||||
layer_base = device + 1;
|
layer_base = device + 1;
|
||||||
|
|
||||||
|
@ -359,6 +367,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
device, &IID_IUnknown, (void **)&device->child_layer)))
|
device, &IID_IUnknown, (void **)&device->child_layer)))
|
||||||
{
|
{
|
||||||
WARN("Failed to create device, returning %#x.\n", hr);
|
WARN("Failed to create device, returning %#x.\n", hr);
|
||||||
|
wined3d_private_store_cleanup(&device->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,6 +376,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
{
|
{
|
||||||
ERR("DXGI device should implement IWineD3DDeviceParent.\n");
|
ERR("DXGI device should implement IWineD3DDeviceParent.\n");
|
||||||
IUnknown_Release(device->child_layer);
|
IUnknown_Release(device->child_layer);
|
||||||
|
wined3d_private_store_cleanup(&device->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
|
wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
|
||||||
|
@ -381,6 +391,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
IUnknown_Release(device->child_layer);
|
IUnknown_Release(device->child_layer);
|
||||||
|
wined3d_private_store_cleanup(&device->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,6 +403,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
{
|
{
|
||||||
WARN("Failed to create a wined3d device, returning %#x.\n", hr);
|
WARN("Failed to create a wined3d device, returning %#x.\n", hr);
|
||||||
IUnknown_Release(device->child_layer);
|
IUnknown_Release(device->child_layer);
|
||||||
|
wined3d_private_store_cleanup(&device->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,6 +416,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
||||||
ERR("Failed to initialize 3D, hr %#x.\n", hr);
|
ERR("Failed to initialize 3D, hr %#x.\n", hr);
|
||||||
wined3d_device_decref(device->wined3d_device);
|
wined3d_device_decref(device->wined3d_device);
|
||||||
IUnknown_Release(device->child_layer);
|
IUnknown_Release(device->child_layer);
|
||||||
|
wined3d_private_store_cleanup(&device->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,12 +82,19 @@ const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
|
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
|
||||||
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
|
||||||
|
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
|
||||||
|
HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
|
||||||
|
HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* IDXGIFactory */
|
/* IDXGIFactory */
|
||||||
struct dxgi_factory
|
struct dxgi_factory
|
||||||
{
|
{
|
||||||
IDXGIFactory1 IDXGIFactory1_iface;
|
IDXGIFactory1 IDXGIFactory1_iface;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
struct wined3d *wined3d;
|
struct wined3d *wined3d;
|
||||||
UINT adapter_count;
|
UINT adapter_count;
|
||||||
IDXGIAdapter1 **adapters;
|
IDXGIAdapter1 **adapters;
|
||||||
|
@ -105,6 +112,7 @@ struct dxgi_device
|
||||||
IWineDXGIDevice IWineDXGIDevice_iface;
|
IWineDXGIDevice IWineDXGIDevice_iface;
|
||||||
IUnknown *child_layer;
|
IUnknown *child_layer;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
struct wined3d_device *wined3d_device;
|
struct wined3d_device *wined3d_device;
|
||||||
IDXGIFactory1 *factory;
|
IDXGIFactory1 *factory;
|
||||||
};
|
};
|
||||||
|
@ -117,6 +125,7 @@ struct dxgi_output
|
||||||
{
|
{
|
||||||
IDXGIOutput IDXGIOutput_iface;
|
IDXGIOutput IDXGIOutput_iface;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
struct dxgi_adapter *adapter;
|
struct dxgi_adapter *adapter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -128,6 +137,7 @@ struct dxgi_adapter
|
||||||
IDXGIAdapter1 IDXGIAdapter1_iface;
|
IDXGIAdapter1 IDXGIAdapter1_iface;
|
||||||
struct dxgi_factory *parent;
|
struct dxgi_factory *parent;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
UINT ordinal;
|
UINT ordinal;
|
||||||
IDXGIOutput *output;
|
IDXGIOutput *output;
|
||||||
};
|
};
|
||||||
|
@ -140,6 +150,7 @@ struct dxgi_swapchain
|
||||||
{
|
{
|
||||||
IDXGISwapChain IDXGISwapChain_iface;
|
IDXGISwapChain IDXGISwapChain_iface;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
struct wined3d_swapchain *wined3d_swapchain;
|
struct wined3d_swapchain *wined3d_swapchain;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -153,6 +164,7 @@ struct dxgi_surface
|
||||||
IUnknown IUnknown_iface;
|
IUnknown IUnknown_iface;
|
||||||
IUnknown *outer_unknown;
|
IUnknown *outer_unknown;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
struct wined3d_private_store private_store;
|
||||||
IDXGIDevice *device;
|
IDXGIDevice *device;
|
||||||
|
|
||||||
DXGI_SURFACE_DESC desc;
|
DXGI_SURFACE_DESC desc;
|
||||||
|
|
|
@ -80,6 +80,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface)
|
||||||
EnterCriticalSection(&dxgi_cs);
|
EnterCriticalSection(&dxgi_cs);
|
||||||
wined3d_decref(factory->wined3d);
|
wined3d_decref(factory->wined3d);
|
||||||
LeaveCriticalSection(&dxgi_cs);
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
wined3d_private_store_cleanup(&factory->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, factory);
|
HeapFree(GetProcessHeap(), 0, factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,25 +90,31 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&factory->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&factory->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&factory->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid, void **parent)
|
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid, void **parent)
|
||||||
|
@ -281,12 +288,14 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
|
||||||
|
|
||||||
factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl;
|
factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl;
|
||||||
factory->refcount = 1;
|
factory->refcount = 1;
|
||||||
|
wined3d_private_store_init(&factory->private_store);
|
||||||
|
|
||||||
EnterCriticalSection(&dxgi_cs);
|
EnterCriticalSection(&dxgi_cs);
|
||||||
factory->wined3d = wined3d_create(0);
|
factory->wined3d = wined3d_create(0);
|
||||||
if (!factory->wined3d)
|
if (!factory->wined3d)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&dxgi_cs);
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
wined3d_private_store_cleanup(&factory->private_store);
|
||||||
return DXGI_ERROR_UNSUPPORTED;
|
return DXGI_ERROR_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,6 +352,7 @@ fail:
|
||||||
EnterCriticalSection(&dxgi_cs);
|
EnterCriticalSection(&dxgi_cs);
|
||||||
wined3d_decref(factory->wined3d);
|
wined3d_decref(factory->wined3d);
|
||||||
LeaveCriticalSection(&dxgi_cs);
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
wined3d_private_store_cleanup(&factory->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,6 +388,7 @@ HWND dxgi_factory_get_device_window(struct dxgi_factory *factory)
|
||||||
if (!(factory->device_window = CreateWindowA("static", "DXGI device window",
|
if (!(factory->device_window = CreateWindowA("static", "DXGI device window",
|
||||||
WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL)))
|
WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL)))
|
||||||
{
|
{
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
ERR("Failed to create a window.\n");
|
ERR("Failed to create a window.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface)
|
||||||
|
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
{
|
{
|
||||||
|
wined3d_private_store_cleanup(&This->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,25 +75,31 @@ static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&output->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&output->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_output *output = impl_from_IDXGIOutput(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&output->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
|
||||||
|
@ -109,9 +116,34 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC *desc)
|
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC *desc)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, desc %p stub!\n", iface, desc);
|
struct dxgi_output *This = impl_from_IDXGIOutput(iface);
|
||||||
|
struct wined3d *wined3d;
|
||||||
|
MONITORINFOEXW monitor_info;
|
||||||
|
|
||||||
return E_NOTIMPL;
|
FIXME("iface %p, desc %p semi-stub!\n", iface, desc);
|
||||||
|
|
||||||
|
if (!desc)
|
||||||
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
|
wined3d = This->adapter->parent->wined3d;
|
||||||
|
|
||||||
|
EnterCriticalSection(&dxgi_cs);
|
||||||
|
desc->Monitor = wined3d_get_adapter_monitor(wined3d, This->adapter->ordinal);
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
|
||||||
|
if (!desc->Monitor)
|
||||||
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
|
monitor_info.cbSize = sizeof(monitor_info);
|
||||||
|
if (!GetMonitorInfoW(desc->Monitor, (MONITORINFO *)&monitor_info))
|
||||||
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
|
memcpy(&desc->DeviceName, &monitor_info.szDevice, sizeof(desc->DeviceName));
|
||||||
|
memcpy(&desc->DesktopCoordinates, &monitor_info.rcMonitor, sizeof(RECT));
|
||||||
|
desc->AttachedToDesktop = TRUE;
|
||||||
|
desc->Rotation = DXGI_MODE_ROTATION_IDENTITY;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
|
||||||
|
@ -284,5 +316,6 @@ void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
|
||||||
{
|
{
|
||||||
output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl;
|
output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl;
|
||||||
output->refcount = 1;
|
output->refcount = 1;
|
||||||
|
wined3d_private_store_init(&output->private_store);
|
||||||
output->adapter = adapter;
|
output->adapter = adapter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,10 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
|
||||||
TRACE("%p decreasing refcount to %u.\n", surface, refcount);
|
TRACE("%p decreasing refcount to %u.\n", surface, refcount);
|
||||||
|
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
|
{
|
||||||
|
wined3d_private_store_cleanup(&surface->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, surface);
|
HeapFree(GetProcessHeap(), 0, surface);
|
||||||
|
}
|
||||||
|
|
||||||
return refcount;
|
return refcount;
|
||||||
}
|
}
|
||||||
|
@ -105,25 +108,31 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&surface->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&surface->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&surface->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent)
|
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent)
|
||||||
|
@ -205,6 +214,7 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
|
||||||
surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl;
|
surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl;
|
||||||
surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl;
|
surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl;
|
||||||
surface->refcount = 1;
|
surface->refcount = 1;
|
||||||
|
wined3d_private_store_init(&surface->private_store);
|
||||||
surface->outer_unknown = outer ? outer : &surface->IUnknown_iface;
|
surface->outer_unknown = outer ? outer : &surface->IUnknown_iface;
|
||||||
surface->device = device;
|
surface->device = device;
|
||||||
surface->desc = *desc;
|
surface->desc = *desc;
|
||||||
|
|
|
@ -77,25 +77,31 @@ static ULONG STDMETHODCALLTYPE dxgi_swapchain_Release(IDXGISwapChain *iface)
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *iface,
|
||||||
REFGUID guid, UINT data_size, const void *data)
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_set_private_data(&swapchain->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain *iface,
|
||||||
REFGUID guid, const IUnknown *object)
|
REFGUID guid, const IUnknown *object)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
|
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
|
||||||
|
|
||||||
|
return dxgi_set_private_data_interface(&swapchain->private_store, guid, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface,
|
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface,
|
||||||
REFGUID guid, UINT *data_size, void *data)
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
|
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||||
|
|
||||||
|
return dxgi_get_private_data(&swapchain->private_store, guid, data_size, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID riid, void **parent)
|
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID riid, void **parent)
|
||||||
|
@ -271,6 +277,9 @@ static const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl =
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *parent)
|
static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *parent)
|
||||||
{
|
{
|
||||||
|
struct dxgi_swapchain *swapchain = parent;
|
||||||
|
|
||||||
|
wined3d_private_store_cleanup(&swapchain->private_store);
|
||||||
HeapFree(GetProcessHeap(), 0, parent);
|
HeapFree(GetProcessHeap(), 0, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,11 +295,13 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
|
||||||
|
|
||||||
swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl;
|
swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl;
|
||||||
swapchain->refcount = 1;
|
swapchain->refcount = 1;
|
||||||
|
wined3d_private_store_init(&swapchain->private_store);
|
||||||
|
|
||||||
if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
|
if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
|
||||||
&dxgi_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain)))
|
&dxgi_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain)))
|
||||||
{
|
{
|
||||||
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
|
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
|
||||||
|
wined3d_private_store_cleanup(&swapchain->private_store);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -319,3 +319,89 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
|
||||||
return WINED3DFMT_UNKNOWN;
|
return WINED3DFMT_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, UINT *data_size, void *data)
|
||||||
|
{
|
||||||
|
const struct wined3d_private_data *stored_data;
|
||||||
|
DWORD size_in;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!data_size)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
EnterCriticalSection(&dxgi_cs);
|
||||||
|
if (!(stored_data = wined3d_private_store_get_private_data(store, guid)))
|
||||||
|
{
|
||||||
|
hr = DXGI_ERROR_NOT_FOUND;
|
||||||
|
*data_size = 0;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_in = *data_size;
|
||||||
|
*data_size = stored_data->size;
|
||||||
|
if (!data)
|
||||||
|
{
|
||||||
|
hr = S_OK;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (size_in < stored_data->size)
|
||||||
|
{
|
||||||
|
hr = DXGI_ERROR_MORE_DATA;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stored_data->flags & WINED3DSPD_IUNKNOWN)
|
||||||
|
IUnknown_AddRef(stored_data->content.object);
|
||||||
|
memcpy(data, stored_data->content.data, stored_data->size);
|
||||||
|
hr = S_OK;
|
||||||
|
|
||||||
|
done:
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, UINT data_size, const void *data)
|
||||||
|
{
|
||||||
|
struct wined3d_private_data *entry;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!data)
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&dxgi_cs);
|
||||||
|
if (!(entry = wined3d_private_store_get_private_data(store, guid)))
|
||||||
|
{
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wined3d_private_store_free_private_data(store, entry);
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
EnterCriticalSection(&dxgi_cs);
|
||||||
|
hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0);
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
|
||||||
|
REFGUID guid, const IUnknown *object)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!object)
|
||||||
|
return dxgi_set_private_data(store, guid, sizeof(object), &object);
|
||||||
|
|
||||||
|
EnterCriticalSection(&dxgi_cs);
|
||||||
|
hr = wined3d_private_store_set_private_data(store,
|
||||||
|
guid, object, sizeof(object), WINED3DSPD_IUNKNOWN);
|
||||||
|
LeaveCriticalSection(&dxgi_cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ reactos/dll/directx/wine/dplay # Synced to Wine-1.7.27
|
||||||
reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.7.37
|
reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
|
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
|
||||||
reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27
|
reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27
|
||||||
reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.27
|
reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27
|
reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27
|
||||||
reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27
|
reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27
|
||||||
reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27
|
reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue