Commit 2c450571 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove COM from the volume implementation.

parent 44c52c16
...@@ -1446,7 +1446,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3 ...@@ -1446,7 +1446,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format,
WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) WINED3DPOOL pool, DWORD usage, struct wined3d_volume **volume)
{ {
HRESULT hr; HRESULT hr;
......
...@@ -363,7 +363,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN ...@@ -363,7 +363,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
hr = E_INVALIDARG; hr = E_INVALIDARG;
else if (SUCCEEDED(hr = IWineD3DVolume_Map(wined3d_volume_from_resource(sub_resource), else if (SUCCEEDED(hr = wined3d_volume_map(wined3d_volume_from_resource(sub_resource),
&wined3d_map_desc, NULL, 0))) &wined3d_map_desc, NULL, 0)))
{ {
mapped_texture->pData = wined3d_map_desc.pBits; mapped_texture->pData = wined3d_map_desc.pBits;
...@@ -384,7 +384,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT ...@@ -384,7 +384,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
return; return;
IWineD3DVolume_Unmap(wined3d_volume_from_resource(sub_resource)); wined3d_volume_unmap(wined3d_volume_from_resource(sub_resource));
} }
static void STDMETHODCALLTYPE d3d10_texture3d_GetDesc(ID3D10Texture3D *iface, D3D10_TEXTURE3D_DESC *desc) static void STDMETHODCALLTYPE d3d10_texture3d_GetDesc(ID3D10Texture3D *iface, D3D10_TEXTURE3D_DESC *desc)
......
...@@ -203,15 +203,9 @@ struct IDirect3DVolume8Impl ...@@ -203,15 +203,9 @@ struct IDirect3DVolume8Impl
{ {
IDirect3DVolume8 IDirect3DVolume8_iface; IDirect3DVolume8 IDirect3DVolume8_iface;
LONG ref; LONG ref;
struct wined3d_volume *wined3d_volume;
/* IDirect3DVolume8 fields */ IUnknown *container;
IWineD3DVolume *wineD3DVolume; IUnknown *forwardReference;
/* The volume container */
IUnknown *container;
/* If set forward refcounting to this object */
IUnknown *forwardReference;
}; };
HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height, HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height,
......
...@@ -2861,7 +2861,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3 ...@@ -2861,7 +2861,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format,
WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) WINED3DPOOL pool, DWORD usage, struct wined3d_volume **volume)
{ {
IDirect3DDevice8Impl *This = impl_from_IWineD3DDeviceParent(iface); IDirect3DDevice8Impl *This = impl_from_IWineD3DDeviceParent(iface);
IDirect3DVolume8Impl *object; IDirect3DVolume8Impl *object;
...@@ -2887,8 +2887,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent ...@@ -2887,8 +2887,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
return hr; return hr;
} }
*volume = object->wineD3DVolume; *volume = object->wined3d_volume;
IWineD3DVolume_AddRef(*volume); wined3d_volume_incref(*volume);
IDirect3DVolume8_Release(&object->IDirect3DVolume8_iface); IDirect3DVolume8_Release(&object->IDirect3DVolume8_iface);
object->container = container_parent; object->container = container_parent;
......
...@@ -66,7 +66,7 @@ static ULONG WINAPI IDirect3DVolume8Impl_AddRef(IDirect3DVolume8 *iface) ...@@ -66,7 +66,7 @@ static ULONG WINAPI IDirect3DVolume8Impl_AddRef(IDirect3DVolume8 *iface)
if (ref == 1) if (ref == 1)
{ {
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DVolume_AddRef(This->wineD3DVolume); wined3d_volume_incref(This->wined3d_volume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
} }
...@@ -93,7 +93,7 @@ static ULONG WINAPI IDirect3DVolume8Impl_Release(IDirect3DVolume8 *iface) ...@@ -93,7 +93,7 @@ static ULONG WINAPI IDirect3DVolume8Impl_Release(IDirect3DVolume8 *iface)
if (ref == 0) { if (ref == 0) {
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DVolume_Release(This->wineD3DVolume); wined3d_volume_decref(This->wined3d_volume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
} }
...@@ -132,7 +132,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(IDirect3DVolume8 *ifac ...@@ -132,7 +132,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(IDirect3DVolume8 *ifac
iface, debugstr_guid(refguid), pData, SizeOfData, Flags); iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_SetPrivateData(This->wineD3DVolume, refguid, pData, SizeOfData, Flags); hr = wined3d_volume_set_private_data(This->wined3d_volume, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -148,7 +148,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(IDirect3DVolume8 *ifac ...@@ -148,7 +148,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(IDirect3DVolume8 *ifac
iface, debugstr_guid(refguid), pData, pSizeOfData); iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_GetPrivateData(This->wineD3DVolume, refguid, pData, pSizeOfData); hr = wined3d_volume_get_private_data(This->wined3d_volume, refguid, pData, pSizeOfData);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -162,7 +162,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(IDirect3DVolume8 *ifa ...@@ -162,7 +162,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(IDirect3DVolume8 *ifa
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid)); TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_FreePrivateData(This->wineD3DVolume, refguid); hr = wined3d_volume_free_private_data(This->wined3d_volume, refguid);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -195,7 +195,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(IDirect3DVolume8 *iface, D3DV ...@@ -195,7 +195,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(IDirect3DVolume8 *iface, D3DV
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_resource = IWineD3DVolume_GetResource(This->wineD3DVolume); wined3d_resource = wined3d_volume_get_resource(This->wined3d_volume);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -221,7 +221,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(IDirect3DVolume8 *iface, ...@@ -221,7 +221,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(IDirect3DVolume8 *iface,
iface, pLockedVolume, pBox, Flags); iface, pLockedVolume, pBox, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume, hr = wined3d_volume_map(This->wined3d_volume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags); (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(IDirect3DVolume8 *iface) ...@@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(IDirect3DVolume8 *iface)
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_Unmap(This->wineD3DVolume); hr = wined3d_volume_unmap(This->wined3d_volume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -278,7 +278,7 @@ HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, ...@@ -278,7 +278,7 @@ HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device,
volume->ref = 1; volume->ref = 1;
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage, hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage,
format, pool, volume, &d3d8_volume_wined3d_parent_ops, &volume->wineD3DVolume); format, pool, volume, &d3d8_volume_wined3d_parent_ops, &volume->wined3d_volume);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create wined3d volume, hr %#x.\n", hr); WARN("Failed to create wined3d volume, hr %#x.\n", hr);
......
...@@ -190,15 +190,9 @@ typedef struct IDirect3DVolume9Impl ...@@ -190,15 +190,9 @@ typedef struct IDirect3DVolume9Impl
/* IUnknown fields */ /* IUnknown fields */
const IDirect3DVolume9Vtbl *lpVtbl; const IDirect3DVolume9Vtbl *lpVtbl;
LONG ref; LONG ref;
struct wined3d_volume *wined3d_volume;
/* IDirect3DVolume9 fields */ IUnknown *container;
IWineD3DVolume *wineD3DVolume; IUnknown *forwardReference;
/* The volume container */
IUnknown *container;
/* If set forward refcounting to this object */
IUnknown *forwardReference;
} IDirect3DVolume9Impl; } IDirect3DVolume9Impl;
HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, UINT width, UINT height, HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, UINT width, UINT height,
......
...@@ -3120,7 +3120,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3 ...@@ -3120,7 +3120,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format,
WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) WINED3DPOOL pool, DWORD usage, struct wined3d_volume **volume)
{ {
struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
IDirect3DVolume9Impl *object; IDirect3DVolume9Impl *object;
...@@ -3146,8 +3146,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent ...@@ -3146,8 +3146,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
return hr; return hr;
} }
*volume = object->wineD3DVolume; *volume = object->wined3d_volume;
IWineD3DVolume_AddRef(*volume); wined3d_volume_incref(*volume);
IDirect3DVolume9_Release((IDirect3DVolume9 *)object); IDirect3DVolume9_Release((IDirect3DVolume9 *)object);
object->container = container_parent; object->container = container_parent;
......
...@@ -60,7 +60,7 @@ static ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) { ...@@ -60,7 +60,7 @@ static ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) {
if (ref == 1) if (ref == 1)
{ {
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DVolume_AddRef(This->wineD3DVolume); wined3d_volume_incref(This->wined3d_volume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
} }
...@@ -85,7 +85,7 @@ static ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) { ...@@ -85,7 +85,7 @@ static ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) {
if (ref == 0) { if (ref == 0) {
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DVolume_Release(This->wineD3DVolume); wined3d_volume_decref(This->wined3d_volume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
} }
...@@ -122,9 +122,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 ifac ...@@ -122,9 +122,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 ifac
iface, debugstr_guid(refguid), pData, SizeOfData, Flags); iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_set_private_data(This->wined3d_volume, refguid, pData, SizeOfData, Flags);
hr = IWineD3DVolume_SetPrivateData(This->wineD3DVolume, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -138,9 +136,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 ifac ...@@ -138,9 +136,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 ifac
iface, debugstr_guid(refguid), pData, pSizeOfData); iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_get_private_data(This->wined3d_volume, refguid, pData, pSizeOfData);
hr = IWineD3DVolume_GetPrivateData(This->wineD3DVolume, refguid, pData, pSizeOfData);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -153,9 +149,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 ifa ...@@ -153,9 +149,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 ifa
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid)); TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_free_private_data(This->wined3d_volume, refguid);
hr = IWineD3DVolume_FreePrivateData(This->wineD3DVolume, refguid);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -185,7 +179,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(IDirect3DVolume9 *iface, D3DV ...@@ -185,7 +179,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(IDirect3DVolume9 *iface, D3DV
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_resource = IWineD3DVolume_GetResource(This->wineD3DVolume); wined3d_resource = wined3d_volume_get_resource(This->wined3d_volume);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -208,10 +202,8 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DL ...@@ -208,10 +202,8 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DL
iface, pLockedVolume, pBox, Flags); iface, pLockedVolume, pBox, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_map(This->wined3d_volume, (WINED3DLOCKED_BOX *)pLockedVolume,
hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags); (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -224,9 +216,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) { ...@@ -224,9 +216,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_unmap(This->wined3d_volume);
hr = IWineD3DVolume_Unmap(This->wineD3DVolume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -268,7 +258,7 @@ HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, ...@@ -268,7 +258,7 @@ HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device,
volume->ref = 1; volume->ref = 1;
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK, hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
format, pool, volume, &d3d9_volume_wined3d_parent_ops, &volume->wineD3DVolume); format, pool, volume, &d3d9_volume_wined3d_parent_ops, &volume->wined3d_volume);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create wined3d volume, hr %#x.\n", hr); WARN("Failed to create wined3d volume, hr %#x.\n", hr);
......
...@@ -5877,7 +5877,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3 ...@@ -5877,7 +5877,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format,
WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) WINED3DPOOL pool, DWORD usage, struct wined3d_volume **volume)
{ {
TRACE("iface %p, container_parent %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p\n", TRACE("iface %p, container_parent %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p\n",
iface, container_parent, width, height, depth, format, pool, usage, volume); iface, container_parent, width, height, depth, format, pool, usage, volume);
......
...@@ -5100,22 +5100,22 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface, ...@@ -5100,22 +5100,22 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface,
/* TODO: Implement direct loading into the gl volume instead of using memcpy and /* TODO: Implement direct loading into the gl volume instead of using memcpy and
* dirtification to improve loading performance. * dirtification to improve loading performance.
*/ */
hr = IWineD3DVolume_Map(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY); hr = wined3d_volume_map(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = IWineD3DVolume_Map(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD); hr = wined3d_volume_map(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD);
if (FAILED(hr)) if (FAILED(hr))
{ {
IWineD3DVolume_Unmap(pSourceVolume); wined3d_volume_unmap(pSourceVolume);
return hr; return hr;
} }
memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size); memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size);
hr = IWineD3DVolume_Unmap(pDestinationVolume); hr = wined3d_volume_unmap(pDestinationVolume);
if (FAILED(hr)) if (FAILED(hr))
IWineD3DVolume_Unmap(pSourceVolume); wined3d_volume_unmap(pSourceVolume);
else else
hr = IWineD3DVolume_Unmap(pSourceVolume); hr = wined3d_volume_unmap(pSourceVolume);
return hr; return hr;
} }
......
...@@ -1186,7 +1186,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource ...@@ -1186,7 +1186,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
/* Cleanup the container. */ /* Cleanup the container. */
volume_set_container(volume, NULL); volume_set_container(volume, NULL);
IWineD3DVolume_Release((IWineD3DVolume *)volume); wined3d_volume_decref(volume);
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright 2002-2005 Jason Edmeades * Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira * Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber * Copyright 2005 Oliver Stieber
* Copyright 2009-2010 Henri Verbeet for CodeWeavers * Copyright 2009-2011 Henri Verbeet for CodeWeavers
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void volume_bind_and_dirtify(struct IWineD3DVolumeImpl *volume, const struct wined3d_gl_info *gl_info) static void volume_bind_and_dirtify(struct wined3d_volume *volume, const struct wined3d_gl_info *gl_info)
{ {
struct wined3d_texture *container = volume->container; struct wined3d_texture *container = volume->container;
DWORD active_sampler; DWORD active_sampler;
...@@ -62,7 +62,7 @@ static void volume_bind_and_dirtify(struct IWineD3DVolumeImpl *volume, const str ...@@ -62,7 +62,7 @@ static void volume_bind_and_dirtify(struct IWineD3DVolumeImpl *volume, const str
container->texture_ops->texture_bind(container, gl_info, FALSE); container->texture_ops->texture_bind(container, gl_info, FALSE);
} }
void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *dirty_box) void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box)
{ {
volume->dirty = TRUE; volume->dirty = TRUE;
if (dirty_box) if (dirty_box)
...@@ -128,195 +128,160 @@ static void volume_unload(struct wined3d_resource *resource) ...@@ -128,195 +128,160 @@ static void volume_unload(struct wined3d_resource *resource)
resource_unload(resource); resource_unload(resource);
} }
/* ******************************************* ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume)
IWineD3DVolume IUnknown parts follow
******************************************* */
static HRESULT WINAPI IWineD3DVolumeImpl_QueryInterface(IWineD3DVolume *iface, REFIID riid, void **object)
{ {
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); ULONG refcount = InterlockedIncrement(&volume->resource.ref);
if (IsEqualGUID(riid, &IID_IWineD3DVolume) TRACE("%p increasing refcount to %u.\n", volume, refcount);
|| IsEqualGUID(riid, &IID_IWineD3DResource)
|| IsEqualGUID(riid, &IID_IWineD3DBase)
|| IsEqualGUID(riid, &IID_IUnknown))
{
IUnknown_AddRef(iface);
*object = iface;
return S_OK;
}
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); return refcount;
*object = NULL;
return E_NOINTERFACE;
}
static ULONG WINAPI IWineD3DVolumeImpl_AddRef(IWineD3DVolume *iface) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
TRACE("(%p) : AddRef increasing from %d\n", This, This->resource.ref);
return InterlockedIncrement(&This->resource.ref);
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) { ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; {
ULONG ref; ULONG refcount = InterlockedDecrement(&volume->resource.ref);
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
ref = InterlockedDecrement(&This->resource.ref); TRACE("%p decreasing refcount to %u.\n", volume, refcount);
if (!ref) if (!refcount)
{ {
resource_cleanup(&This->resource); resource_cleanup(&volume->resource);
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, volume);
} }
return ref;
return refcount;
} }
/* **************************************************** void * CDECL wined3d_volume_get_parent(const struct wined3d_volume *volume)
IWineD3DVolume IWineD3DResource parts follow
**************************************************** */
static void * WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface)
{ {
TRACE("iface %p.\n", iface); TRACE("volume %p.\n", volume);
return ((IWineD3DVolumeImpl *)iface)->resource.parent; return volume->resource.parent;
} }
static HRESULT WINAPI IWineD3DVolumeImpl_SetPrivateData(IWineD3DVolume *iface, HRESULT CDECL wined3d_volume_set_private_data(struct wined3d_volume *volume,
REFGUID riid, const void *data, DWORD data_size, DWORD flags) REFGUID guid, const void *data, DWORD data_size, DWORD flags)
{ {
return resource_set_private_data(&((IWineD3DVolumeImpl *)iface)->resource, riid, data, data_size, flags); return resource_set_private_data(&volume->resource, guid, data, data_size, flags);
} }
static HRESULT WINAPI IWineD3DVolumeImpl_GetPrivateData(IWineD3DVolume *iface, HRESULT CDECL wined3d_volume_get_private_data(const struct wined3d_volume *volume,
REFGUID guid, void *data, DWORD *data_size) REFGUID guid, void *data, DWORD *data_size)
{ {
return resource_get_private_data(&((IWineD3DVolumeImpl *)iface)->resource, guid, data, data_size); return resource_get_private_data(&volume->resource, guid, data, data_size);
} }
static HRESULT WINAPI IWineD3DVolumeImpl_FreePrivateData(IWineD3DVolume *iface, REFGUID refguid) HRESULT CDECL wined3d_volume_free_private_data(struct wined3d_volume *volume, REFGUID guid)
{ {
return resource_free_private_data(&((IWineD3DVolumeImpl *)iface)->resource, refguid); return resource_free_private_data(&volume->resource, guid);
} }
static DWORD WINAPI IWineD3DVolumeImpl_SetPriority(IWineD3DVolume *iface, DWORD priority) DWORD CDECL wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD priority)
{ {
return resource_set_priority(&((IWineD3DVolumeImpl *)iface)->resource, priority); return resource_set_priority(&volume->resource, priority);
} }
static DWORD WINAPI IWineD3DVolumeImpl_GetPriority(IWineD3DVolume *iface) DWORD CDECL wined3d_volume_get_priority(const struct wined3d_volume *volume)
{ {
return resource_get_priority(&((IWineD3DVolumeImpl *)iface)->resource); return resource_get_priority(&volume->resource);
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static void WINAPI IWineD3DVolumeImpl_PreLoad(IWineD3DVolume *iface) { void CDECL wined3d_volume_preload(struct wined3d_volume *volume)
FIXME("iface %p stub!\n", iface); {
FIXME("volume %p stub!\n", volume);
} }
static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeImpl_GetType(IWineD3DVolume *iface) WINED3DRESOURCETYPE CDECL wined3d_volume_get_type(const struct wined3d_volume *volume)
{ {
return resource_get_type(&((IWineD3DVolumeImpl *)iface)->resource); return resource_get_type(&volume->resource);
} }
static struct wined3d_resource * WINAPI IWineD3DVolumeImpl_GetResource(IWineD3DVolume *iface) struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volume *volume)
{ {
TRACE("iface %p.\n", iface); TRACE("volume %p.\n", volume);
return &((IWineD3DVolumeImpl *)iface)->resource; return &volume->resource;
} }
static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface, HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
WINED3DLOCKED_BOX *pLockedVolume, const WINED3DBOX *pBox, DWORD flags) WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags)
{ {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; TRACE("volume %p, locked_box %p, box %p, flags %#x.\n",
FIXME("(%p) : pBox=%p stub\n", This, pBox); volume, locked_box, box, flags);
if(!This->resource.allocatedMemory) { if (!volume->resource.allocatedMemory)
This->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->resource.size); volume->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, volume->resource.size);
}
/* fixme: should we really lock as such? */ TRACE("allocatedMemory %p.\n", volume->resource.allocatedMemory);
TRACE("(%p) : box=%p, output pbox=%p, allMem=%p\n", This, pBox, pLockedVolume, This->resource.allocatedMemory);
pLockedVolume->RowPitch = This->resource.format->byte_count * This->resource.width; /* Bytes / row */ locked_box->RowPitch = volume->resource.format->byte_count * volume->resource.width; /* Bytes / row */
pLockedVolume->SlicePitch = This->resource.format->byte_count locked_box->SlicePitch = volume->resource.format->byte_count
* This->resource.width * This->resource.height; /* Bytes / slice */ * volume->resource.width * volume->resource.height; /* Bytes / slice */
if (!pBox) { if (!box)
{
TRACE("No box supplied - all is ok\n"); TRACE("No box supplied - all is ok\n");
pLockedVolume->pBits = This->resource.allocatedMemory; locked_box->pBits = volume->resource.allocatedMemory;
This->lockedBox.Left = 0; volume->lockedBox.Left = 0;
This->lockedBox.Top = 0; volume->lockedBox.Top = 0;
This->lockedBox.Front = 0; volume->lockedBox.Front = 0;
This->lockedBox.Right = This->resource.width; volume->lockedBox.Right = volume->resource.width;
This->lockedBox.Bottom = This->resource.height; volume->lockedBox.Bottom = volume->resource.height;
This->lockedBox.Back = This->resource.depth; volume->lockedBox.Back = volume->resource.depth;
} else { }
TRACE("Lock Box (%p) = l %d, t %d, r %d, b %d, fr %d, ba %d\n", pBox, pBox->Left, pBox->Top, pBox->Right, pBox->Bottom, pBox->Front, pBox->Back); else
pLockedVolume->pBits = This->resource.allocatedMemory {
+ (pLockedVolume->SlicePitch * pBox->Front) /* FIXME: is front < back or vica versa? */ TRACE("Lock Box (%p) = l %d, t %d, r %d, b %d, fr %d, ba %d\n",
+ (pLockedVolume->RowPitch * pBox->Top) box, box->Left, box->Top, box->Right, box->Bottom, box->Front, box->Back);
+ (pBox->Left * This->resource.format->byte_count); locked_box->pBits = volume->resource.allocatedMemory
This->lockedBox.Left = pBox->Left; + (locked_box->SlicePitch * box->Front) /* FIXME: is front < back or vica versa? */
This->lockedBox.Top = pBox->Top; + (locked_box->RowPitch * box->Top)
This->lockedBox.Front = pBox->Front; + (box->Left * volume->resource.format->byte_count);
This->lockedBox.Right = pBox->Right; volume->lockedBox.Left = box->Left;
This->lockedBox.Bottom = pBox->Bottom; volume->lockedBox.Top = box->Top;
This->lockedBox.Back = pBox->Back; volume->lockedBox.Front = box->Front;
volume->lockedBox.Right = box->Right;
volume->lockedBox.Bottom = box->Bottom;
volume->lockedBox.Back = box->Back;
} }
if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY))) if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY)))
{ {
volume_add_dirty_box(This, &This->lockedBox); volume_add_dirty_box(volume, &volume->lockedBox);
wined3d_texture_set_dirty(This->container, TRUE); wined3d_texture_set_dirty(volume->container, TRUE);
} }
This->locked = TRUE; volume->locked = TRUE;
TRACE("returning memory@%p rpitch(%d) spitch(%d)\n", pLockedVolume->pBits, pLockedVolume->RowPitch, pLockedVolume->SlicePitch);
TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n",
locked_box->pBits, locked_box->RowPitch, locked_box->SlicePitch);
return WINED3D_OK; return WINED3D_OK;
} }
IWineD3DVolume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource)
{ {
return (IWineD3DVolume *)volume_from_resource(resource); return volume_from_resource(resource);
} }
static HRESULT WINAPI IWineD3DVolumeImpl_Unmap(IWineD3DVolume *iface) HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
{ {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; TRACE("volume %p.\n", volume);
if (!This->locked)
if (!volume->locked)
{ {
WARN("Trying to unlock unlocked volume %p.\n", iface); WARN("Trying to unlock unlocked volume %p.\n", volume);
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
TRACE("(%p) : unlocking volume\n", This);
This->locked = FALSE; volume->locked = FALSE;
memset(&This->lockedBox, 0, sizeof(This->lockedBox)); memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
return WINED3D_OK; return WINED3D_OK;
} }
static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
{
/* IUnknown */
IWineD3DVolumeImpl_QueryInterface,
IWineD3DVolumeImpl_AddRef,
IWineD3DVolumeImpl_Release,
/* IWineD3DResource */
IWineD3DVolumeImpl_GetParent,
IWineD3DVolumeImpl_SetPrivateData,
IWineD3DVolumeImpl_GetPrivateData,
IWineD3DVolumeImpl_FreePrivateData,
IWineD3DVolumeImpl_SetPriority,
IWineD3DVolumeImpl_GetPriority,
IWineD3DVolumeImpl_PreLoad,
IWineD3DVolumeImpl_GetType,
/* IWineD3DVolume */
IWineD3DVolumeImpl_GetResource,
IWineD3DVolumeImpl_Map,
IWineD3DVolumeImpl_Unmap,
};
static const struct wined3d_resource_ops volume_resource_ops = static const struct wined3d_resource_ops volume_resource_ops =
{ {
volume_unload, volume_unload,
...@@ -336,8 +301,6 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT ...@@ -336,8 +301,6 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
volume->lpVtbl = &IWineD3DVolume_Vtbl;
hr = resource_init(&volume->resource, device, WINED3DRTYPE_VOLUME, format, hr = resource_init(&volume->resource, device, WINED3DRTYPE_VOLUME, format,
WINED3DMULTISAMPLE_NONE, 0, usage, pool, width, height, depth, WINED3DMULTISAMPLE_NONE, 0, usage, pool, width, height, depth,
width * height * depth * format->byte_count, parent, parent_ops, width * height * depth * format->byte_count, parent, parent_ops,
......
...@@ -114,4 +114,17 @@ ...@@ -114,4 +114,17 @@
@ cdecl wined3d_vertex_declaration_get_parent(ptr) @ cdecl wined3d_vertex_declaration_get_parent(ptr)
@ cdecl wined3d_vertex_declaration_incref(ptr) @ cdecl wined3d_vertex_declaration_incref(ptr)
@ cdecl wined3d_volume_decref(ptr)
@ cdecl wined3d_volume_free_private_data(ptr ptr)
@ cdecl wined3d_volume_from_resource(ptr) @ cdecl wined3d_volume_from_resource(ptr)
@ cdecl wined3d_volume_get_parent(ptr)
@ cdecl wined3d_volume_get_priority(ptr)
@ cdecl wined3d_volume_get_private_data(ptr ptr ptr ptr)
@ cdecl wined3d_volume_get_resource(ptr)
@ cdecl wined3d_volume_get_type(ptr)
@ cdecl wined3d_volume_incref(ptr)
@ cdecl wined3d_volume_map(ptr ptr ptr long)
@ cdecl wined3d_volume_preload(ptr)
@ cdecl wined3d_volume_set_priority(ptr long)
@ cdecl wined3d_volume_set_private_data(ptr ptr ptr long long)
@ cdecl wined3d_volume_unmap(ptr)
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl; typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl; typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
typedef struct wined3d_volume IWineD3DVolumeImpl;
typedef struct wined3d_volume IWineD3DVolume;
/* Texture format fixups */ /* Texture format fixups */
...@@ -1942,10 +1944,8 @@ HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT hei ...@@ -1942,10 +1944,8 @@ HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT hei
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
typedef struct IWineD3DVolumeImpl struct wined3d_volume
{ {
/* IUnknown & WineD3DResource fields */
const IWineD3DVolumeVtbl *lpVtbl;
struct wined3d_resource resource; struct wined3d_resource resource;
struct wined3d_texture *container; struct wined3d_texture *container;
BOOL lockable; BOOL lockable;
...@@ -1953,14 +1953,14 @@ typedef struct IWineD3DVolumeImpl ...@@ -1953,14 +1953,14 @@ typedef struct IWineD3DVolumeImpl
WINED3DBOX lockedBox; WINED3DBOX lockedBox;
WINED3DBOX dirtyBox; WINED3DBOX dirtyBox;
BOOL dirty; BOOL dirty;
} IWineD3DVolumeImpl; };
static inline IWineD3DVolumeImpl *volume_from_resource(struct wined3d_resource *resource) static inline IWineD3DVolumeImpl *volume_from_resource(struct wined3d_resource *resource)
{ {
return CONTAINING_RECORD(resource, IWineD3DVolumeImpl, resource); return CONTAINING_RECORD(resource, IWineD3DVolumeImpl, resource);
} }
void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN; void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN;
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width, HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
......
...@@ -2087,7 +2087,6 @@ struct wined3d_parent_ops ...@@ -2087,7 +2087,6 @@ struct wined3d_parent_ops
}; };
interface IWineD3DSurface; interface IWineD3DSurface;
interface IWineD3DVolume;
interface IWineD3DDevice; interface IWineD3DDevice;
struct wined3d; struct wined3d;
struct wined3d_buffer; struct wined3d_buffer;
...@@ -2101,6 +2100,7 @@ struct wined3d_stateblock; ...@@ -2101,6 +2100,7 @@ struct wined3d_stateblock;
struct wined3d_swapchain; struct wined3d_swapchain;
struct wined3d_texture; struct wined3d_texture;
struct wined3d_vertex_declaration; struct wined3d_vertex_declaration;
struct wined3d_volume;
[ [
object, object,
...@@ -2154,7 +2154,7 @@ interface IWineD3DDeviceParent : IUnknown ...@@ -2154,7 +2154,7 @@ interface IWineD3DDeviceParent : IUnknown
[in] enum wined3d_format_id format_id, [in] enum wined3d_format_id format_id,
[in] WINED3DPOOL pool, [in] WINED3DPOOL pool,
[in] DWORD usage, [in] DWORD usage,
[out] IWineD3DVolume **volume [out] struct wined3d_volume **volume
); );
HRESULT CreateSwapChain( HRESULT CreateSwapChain(
...@@ -2310,24 +2310,6 @@ interface IWineD3DSurface : IWineD3DResource ...@@ -2310,24 +2310,6 @@ interface IWineD3DSurface : IWineD3DResource
[ [
object, object,
local, local,
uuid(24769ed8-6f30-11d9-c687-00046142c14f)
]
interface IWineD3DVolume : IWineD3DResource
{
struct wined3d_resource *GetResource(
);
HRESULT Map(
[out] WINED3DLOCKED_BOX *locked_box,
[in] const WINED3DBOX *box,
[in] DWORD flags
);
HRESULT Unmap(
);
}
[
object,
local,
uuid(6d10a2ce-09d0-4a53-a427-11388f9f8ca5) uuid(6d10a2ce-09d0-4a53-a427-11388f9f8ca5)
] ]
interface IWineD3DDevice : IUnknown interface IWineD3DDevice : IUnknown
...@@ -2412,7 +2394,7 @@ interface IWineD3DDevice : IUnknown ...@@ -2412,7 +2394,7 @@ interface IWineD3DDevice : IUnknown
[in] WINED3DPOOL pool, [in] WINED3DPOOL pool,
[in] void *parent, [in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops, [in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DVolume **volume [out] struct wined3d_volume **volume
); );
HRESULT CreateCubeTexture( HRESULT CreateCubeTexture(
[in] UINT edge_length, [in] UINT edge_length,
...@@ -3083,4 +3065,20 @@ ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaratio ...@@ -3083,4 +3065,20 @@ ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaratio
void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration); void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration);
ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration); ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
IWineD3DVolume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource); ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_free_private_data(struct wined3d_volume *volume, REFGUID guid);
struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource);
void * __cdecl wined3d_volume_get_parent(const struct wined3d_volume *volume);
DWORD __cdecl wined3d_volume_get_priority(const struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_get_private_data(const struct wined3d_volume *volume,
REFGUID guid, void *data, DWORD *data_size);
struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
WINED3DRESOURCETYPE __cdecl wined3d_volume_get_type(const struct wined3d_volume *volume);
ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags);
void __cdecl wined3d_volume_preload(struct wined3d_volume *volume);
DWORD __cdecl wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD new_priority);
HRESULT __cdecl wined3d_volume_set_private_data(struct wined3d_volume *volume,
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment