From 8809ebdf790a651342f07a54e25e9e6a24fe3f42 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 9 Mar 2011 19:16:16 +0100 Subject: [PATCH] wined3d: Generalize GetSurfaceLevel() / GetVolumeLevel() to GetSubResource(). --- dlls/d3d8/cubetexture.c | 24 ++++++++++++------------ dlls/d3d8/texture.c | 22 +++++++++++----------- dlls/d3d8/volumetexture.c | 22 +++++++++++----------- dlls/d3d9/cubetexture.c | 24 ++++++++++++------------ dlls/d3d9/texture.c | 22 +++++++++++----------- dlls/d3d9/volumetexture.c | 22 ++++++++++------------ dlls/wined3d/cubetexture.c | 23 +++++------------------ dlls/wined3d/device.c | 26 ++++++++++++-------------- dlls/wined3d/texture.c | 22 +++++----------------- dlls/wined3d/volumetexture.c | 22 +++++----------------- include/wine/wined3d.idl | 15 +++------------ 11 files changed, 97 insertions(+), 147 deletions(-) diff --git a/dlls/d3d8/cubetexture.c b/dlls/d3d8/cubetexture.c index 298988d2f6a..b1a7e52e8c0 100644 --- a/dlls/d3d8/cubetexture.c +++ b/dlls/d3d8/cubetexture.c @@ -279,27 +279,27 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(IDirect3DCubeTextur } static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(IDirect3DCubeTexture8 *iface, - D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8 **ppCubeMapSurface) + D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface) { - IDirect3DCubeTexture8Impl *This = impl_from_IDirect3DCubeTexture8(iface); - IWineD3DSurface *mySurface = NULL; + IDirect3DCubeTexture8Impl *texture = impl_from_IDirect3DCubeTexture8(iface); + struct wined3d_resource *sub_resource; UINT sub_resource_idx; - HRESULT hr; - TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, FaceType, Level, ppCubeMapSurface); + TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface); wined3d_mutex_lock(); - sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(This->wineD3DCubeTexture) * FaceType + Level; - hr = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, sub_resource_idx, &mySurface); - if (SUCCEEDED(hr) && ppCubeMapSurface) + sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(texture->wineD3DCubeTexture) * face + level; + if (!(sub_resource = IWineD3DCubeTexture_GetSubResource(texture->wineD3DCubeTexture, sub_resource_idx))) { - *ppCubeMapSurface = IWineD3DCubeTexture_GetParent(mySurface); - IDirect3DSurface8_AddRef(*ppCubeMapSurface); - IWineD3DCubeTexture_Release(mySurface); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + + *surface = wined3d_resource_get_parent(sub_resource); + IDirect3DSurface8_AddRef(*surface); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(IDirect3DCubeTexture8 *iface, diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index c7bc4bd62b7..949457d4e2a 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -276,25 +276,25 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(IDirect3DTexture8 *ifac } static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *iface, - UINT Level, IDirect3DSurface8 **ppSurfaceLevel) + UINT level, IDirect3DSurface8 **surface) { - IDirect3DTexture8Impl *This = impl_from_IDirect3DTexture8(iface); - IWineD3DSurface *mySurface = NULL; - HRESULT hr; + IDirect3DTexture8Impl *texture = impl_from_IDirect3DTexture8(iface); + struct wined3d_resource *sub_resource; - TRACE("iface %p, level %u, surface %p.\n", iface, Level, ppSurfaceLevel); + TRACE("iface %p, level %u, surface %p.\n", iface, level, surface); wined3d_mutex_lock(); - hr = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface); - if (SUCCEEDED(hr) && ppSurfaceLevel) + if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level))) { - *ppSurfaceLevel = IWineD3DSurface_GetParent(mySurface); - IDirect3DSurface8_AddRef(*ppSurfaceLevel); - IWineD3DSurface_Release(mySurface); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + + *surface = wined3d_resource_get_parent(sub_resource); + IDirect3DSurface8_AddRef(*surface); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, UINT Level, diff --git a/dlls/d3d8/volumetexture.c b/dlls/d3d8/volumetexture.c index 6b4ce3aee2a..de91216e08e 100644 --- a/dlls/d3d8/volumetexture.c +++ b/dlls/d3d8/volumetexture.c @@ -253,25 +253,25 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(IDirect3DVolumeTe } static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(IDirect3DVolumeTexture8 *iface, - UINT Level, IDirect3DVolume8 **ppVolumeLevel) + UINT level, IDirect3DVolume8 **volume) { - IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface; - IWineD3DVolume *myVolume = NULL; - HRESULT hr; + IDirect3DVolumeTexture8Impl *texture = (IDirect3DVolumeTexture8Impl *)iface; + struct wined3d_resource *sub_resource; - TRACE("iface %p, level %u, volume %p.\n", iface, Level, ppVolumeLevel); + TRACE("iface %p, level %u, volume %p.\n", iface, level, volume); wined3d_mutex_lock(); - hr = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume); - if (SUCCEEDED(hr) && ppVolumeLevel) + if (!(sub_resource = IWineD3DVolumeTexture_GetSubResource(texture->wineD3DVolumeTexture, level))) { - *ppVolumeLevel = IWineD3DVolumeTexture_GetParent(myVolume); - IDirect3DVolume8_AddRef(*ppVolumeLevel); - IWineD3DVolumeTexture_Release(myVolume); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + + *volume = wined3d_resource_get_parent(sub_resource); + IDirect3DVolume8_AddRef(*volume); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX *pLockedVolume, CONST D3DBOX *pBox, DWORD Flags) { diff --git a/dlls/d3d9/cubetexture.c b/dlls/d3d9/cubetexture.c index eacc61eacff..a628bb8c6c3 100644 --- a/dlls/d3d9/cubetexture.c +++ b/dlls/d3d9/cubetexture.c @@ -295,27 +295,27 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(IDirect3DCubeTextur } static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(IDirect3DCubeTexture9 *iface, - D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9 **ppCubeMapSurface) + D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface9 **surface) { - IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface; - IWineD3DSurface *mySurface = NULL; + IDirect3DCubeTexture9Impl *texture = (IDirect3DCubeTexture9Impl *)iface; + struct wined3d_resource *sub_resource; UINT sub_resource_idx; - HRESULT hr; - TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, FaceType, Level, ppCubeMapSurface); + TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface); wined3d_mutex_lock(); - sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(This->wineD3DCubeTexture) * FaceType + Level; - hr = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, sub_resource_idx, &mySurface); - if (SUCCEEDED(hr) && ppCubeMapSurface) + sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(texture->wineD3DCubeTexture) * face + level; + if (!(sub_resource = IWineD3DCubeTexture_GetSubResource(texture->wineD3DCubeTexture, sub_resource_idx))) { - *ppCubeMapSurface = IWineD3DCubeTexture_GetParent(mySurface); - IDirect3DSurface9_AddRef(*ppCubeMapSurface); - IWineD3DCubeTexture_Release(mySurface); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + + *surface = wined3d_resource_get_parent(sub_resource); + IDirect3DSurface9_AddRef(*surface); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(IDirect3DCubeTexture9 *iface, diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index e94a172f975..2b874172f21 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -291,25 +291,25 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(IDirect3DTexture9 *ifac } static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *iface, - UINT Level, IDirect3DSurface9 **ppSurfaceLevel) + UINT level, IDirect3DSurface9 **surface) { - IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface; - IWineD3DSurface *mySurface = NULL; - HRESULT hr; + IDirect3DTexture9Impl *texture = (IDirect3DTexture9Impl *)iface; + struct wined3d_resource *sub_resource; - TRACE("iface %p, level %u, surface %p.\n", iface, Level, ppSurfaceLevel); + TRACE("iface %p, level %u, surface %p.\n", iface, level, surface); wined3d_mutex_lock(); - hr = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface); - if (SUCCEEDED(hr) && ppSurfaceLevel) + if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level))) { - *ppSurfaceLevel = IWineD3DSurface_GetParent(mySurface); - IDirect3DSurface9_AddRef(*ppSurfaceLevel); - IWineD3DSurface_Release(mySurface); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + + *surface = wined3d_resource_get_parent(sub_resource); + IDirect3DSurface9_AddRef(*surface); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) { diff --git a/dlls/d3d9/volumetexture.c b/dlls/d3d9/volumetexture.c index c976e8794ed..83b92d836a9 100644 --- a/dlls/d3d9/volumetexture.c +++ b/dlls/d3d9/volumetexture.c @@ -317,27 +317,25 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(IDirect3DVolumeTe } static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(IDirect3DVolumeTexture9 *iface, - UINT Level, IDirect3DVolume9 **ppVolumeLevel) + UINT level, IDirect3DVolume9 **volume) { - IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; - IWineD3DVolume *myVolume = NULL; - HRESULT hr; + IDirect3DVolumeTexture9Impl *texture = (IDirect3DVolumeTexture9Impl *)iface; + struct wined3d_resource *sub_resource; - TRACE("iface %p, level %u, volume %p.\n", iface, Level, ppVolumeLevel); + TRACE("iface %p, level %u, volume %p.\n", iface, level, volume); wined3d_mutex_lock(); - - hr = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume); - if (SUCCEEDED(hr) && ppVolumeLevel) + if (!(sub_resource = IWineD3DVolumeTexture_GetSubResource(texture->wineD3DVolumeTexture, level))) { - *ppVolumeLevel = IWineD3DVolumeTexture_GetParent(myVolume); - IDirect3DVolumeTexture9_AddRef(*ppVolumeLevel); - IWineD3DVolumeTexture_Release(myVolume); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; } + *volume = wined3d_resource_get_parent(sub_resource); + IDirect3DVolumeTexture9_AddRef(*volume); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) { diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 3e673df88bf..66e6c94190f 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -345,27 +345,14 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetSubResourceDesc(IWineD3DCubeTex return WINED3D_OK; } -static HRESULT WINAPI IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeTexture *iface, - UINT sub_resource_idx, IWineD3DSurface **surface) +static struct wined3d_resource * WINAPI IWineD3DCubeTextureImpl_GetSubResource(IWineD3DCubeTexture *iface, + UINT sub_resource_idx) { IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; - struct wined3d_resource *sub_resource; - TRACE("iface %p, sub_resource_idx %u, surface %p.\n", - iface, sub_resource_idx, surface); + TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); - if (!(sub_resource = basetexture_get_sub_resource(texture, sub_resource_idx))) - { - WARN("Failed to get sub-resource.\n"); - return WINED3DERR_INVALIDCALL; - } - - *surface = (IWineD3DSurface *)surface_from_resource(sub_resource); - IWineD3DSurface_AddRef(*surface); - - TRACE("Returning surface %p.\n", *surface); - - return WINED3D_OK; + return basetexture_get_sub_resource(texture, sub_resource_idx); } static HRESULT WINAPI IWineD3DCubeTextureImpl_Map(IWineD3DCubeTexture *iface, @@ -451,8 +438,8 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = IWineD3DCubeTextureImpl_GenerateMipSubLevels, IWineD3DCubeTextureImpl_IsCondNP2, IWineD3DCubeTextureImpl_GetSubResourceDesc, + IWineD3DCubeTextureImpl_GetSubResource, /* IWineD3DCubeTexture */ - IWineD3DCubeTextureImpl_GetCubeMapSurface, IWineD3DCubeTextureImpl_Map, IWineD3DCubeTextureImpl_Unmap, IWineD3DCubeTextureImpl_AddDirtyRect diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4343f831243..4bb96ceb353 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5124,11 +5124,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface, for (i = 0; i < level_count; ++i) { - IWineD3DTexture_GetSurfaceLevel((IWineD3DTexture *)src_texture, i, &src_surface); - IWineD3DTexture_GetSurfaceLevel((IWineD3DTexture *)dst_texture, i, &dst_surface); + src_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)src_texture, i)); + dst_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)dst_texture, i)); hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL); - IWineD3DSurface_Release(dst_surface); - IWineD3DSurface_Release(src_surface); if (FAILED(hr)) { WARN("IWineD3DDevice_UpdateSurface failed, hr %#x.\n", hr); @@ -5145,13 +5145,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface, for (i = 0; i < level_count * 6; ++i) { - hr = IWineD3DCubeTexture_GetCubeMapSurface((IWineD3DCubeTexture *)src_texture, i, &src_surface); - if (FAILED(hr)) ERR("Failed to get src cube sub-resource %u, hr %#x.\n", i, hr); - hr = IWineD3DCubeTexture_GetCubeMapSurface((IWineD3DCubeTexture *)dst_texture, i, &dst_surface); - if (FAILED(hr)) ERR("Failed to get dst cube sub-resource %u, hr %#x.\n", i, hr); + src_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)src_texture, i)); + dst_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)dst_texture, i)); hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL); - IWineD3DSurface_Release(dst_surface); - IWineD3DSurface_Release(src_surface); if (FAILED(hr)) { WARN("IWineD3DDevice_UpdateSurface failed, hr %#x.\n", hr); @@ -5168,11 +5166,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface, for (i = 0; i < level_count; ++i) { - IWineD3DVolumeTexture_GetVolumeLevel((IWineD3DVolumeTexture *)src_texture, i, &src_volume); - IWineD3DVolumeTexture_GetVolumeLevel((IWineD3DVolumeTexture *)dst_texture, i, &dst_volume); + src_volume = (IWineD3DVolume *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)src_texture, i)); + dst_volume = (IWineD3DVolume *)surface_from_resource(basetexture_get_sub_resource( + (IWineD3DBaseTextureImpl *)dst_texture, i)); hr = IWineD3DDeviceImpl_UpdateVolume(iface, src_volume, dst_volume); - IWineD3DVolume_Release(dst_volume); - IWineD3DVolume_Release(src_volume); if (FAILED(hr)) { WARN("IWineD3DDeviceImpl_UpdateVolume failed, hr %#x.\n", hr); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a5a3d655fa1..de7488bb145 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -370,26 +370,14 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSubResourceDesc(IWineD3DTexture *if return WINED3D_OK; } -static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface, - UINT sub_resource_idx, IWineD3DSurface **surface) +static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWineD3DTexture *iface, + UINT sub_resource_idx) { IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; - struct wined3d_resource *sub_resource; - TRACE("iface %p, sub_resource_idx %u, surface %p.\n", iface, sub_resource_idx, surface); + TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); - if (!(sub_resource = basetexture_get_sub_resource(texture, sub_resource_idx))) - { - WARN("Failed to get sub-resource.\n"); - return WINED3DERR_INVALIDCALL; - } - - *surface = (IWineD3DSurface *)surface_from_resource(sub_resource); - IWineD3DSurface_AddRef(*surface); - - TRACE("Returning surface %p.\n", *surface); - - return WINED3D_OK; + return basetexture_get_sub_resource(texture, sub_resource_idx); } static HRESULT WINAPI IWineD3DTextureImpl_Map(IWineD3DTexture *iface, @@ -469,8 +457,8 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl = IWineD3DTextureImpl_GenerateMipSubLevels, IWineD3DTextureImpl_IsCondNP2, IWineD3DTextureImpl_GetSubResourceDesc, + IWineD3DTextureImpl_GetSubResource, /* IWineD3DTexture */ - IWineD3DTextureImpl_GetSurfaceLevel, IWineD3DTextureImpl_Map, IWineD3DTextureImpl_Unmap, IWineD3DTextureImpl_AddDirtyRect diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 06cd6d9c53e..f2ca9391acd 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -282,26 +282,14 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetSubResourceDesc(IWineD3DVolum return WINED3D_OK; } -static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetVolumeLevel(IWineD3DVolumeTexture *iface, - UINT sub_resource_idx, IWineD3DVolume **volume) +static struct wined3d_resource * WINAPI IWineD3DVolumeTextureImpl_GetSubResource(IWineD3DVolumeTexture *iface, + UINT sub_resource_idx) { IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; - struct wined3d_resource *sub_resource; - TRACE("iface %p, sub_resource_idx %u, volume %p.\n", iface, sub_resource_idx, volume); + TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); - if (!(sub_resource = basetexture_get_sub_resource(texture, sub_resource_idx))) - { - WARN("Failed to get sub-resource.\n"); - return WINED3DERR_INVALIDCALL; - } - - *volume = (IWineD3DVolume *)volume_from_resource(sub_resource); - IWineD3DVolume_AddRef(*volume); - - TRACE("Returning volume %p.\n", *volume); - - return WINED3D_OK; + return basetexture_get_sub_resource(texture, sub_resource_idx); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_Map(IWineD3DVolumeTexture *iface, @@ -382,8 +370,8 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl = IWineD3DVolumeTextureImpl_GenerateMipSubLevels, IWineD3DVolumeTextureImpl_IsCondNP2, IWineD3DVolumeTextureImpl_GetSubResourceDesc, + IWineD3DVolumeTextureImpl_GetSubResource, /* volume texture */ - IWineD3DVolumeTextureImpl_GetVolumeLevel, IWineD3DVolumeTextureImpl_Map, IWineD3DVolumeTextureImpl_Unmap, IWineD3DVolumeTextureImpl_AddDirtyBox diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 8acc0bb005a..0ce41f8f311 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -2366,6 +2366,9 @@ interface IWineD3DBaseTexture : IWineD3DResource [in] UINT sub_resource_idx, [out] struct wined3d_resource_desc *desc ); + struct wined3d_resource *GetSubResource( + [in] UINT sub_resource_idx + ); } [ @@ -2375,10 +2378,6 @@ interface IWineD3DBaseTexture : IWineD3DResource ] interface IWineD3DTexture : IWineD3DBaseTexture { - HRESULT GetSurfaceLevel( - [in] UINT sub_resource_idx, - [out] IWineD3DSurface **surface - ); HRESULT Map( [in] UINT sub_resource_idx, [out] WINED3DLOCKED_RECT *locked_rect, @@ -2400,10 +2399,6 @@ interface IWineD3DTexture : IWineD3DBaseTexture ] interface IWineD3DCubeTexture : IWineD3DBaseTexture { - HRESULT GetCubeMapSurface( - [in] UINT sub_resource_idx, - [out] IWineD3DSurface **surface - ); HRESULT Map( [in] UINT sub_resource_idx, [out] WINED3DLOCKED_RECT *locked_rect, @@ -2426,10 +2421,6 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture ] interface IWineD3DVolumeTexture : IWineD3DBaseTexture { - HRESULT GetVolumeLevel( - [in] UINT sub_resource_idx, - [out] IWineD3DVolume **volume - ); HRESULT Map( [in] UINT sub_resource_idx, [out] WINED3DLOCKED_BOX *locked_box,