d3d8: Use wined3d_texture_get_sub_resource_desc() in d3d8_surface_GetDesc().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-02-29 18:19:24 +01:00 committed by Alexandre Julliard
parent 5c27fef77a
commit 9a6ee515ed

View File

@ -175,18 +175,16 @@ static HRESULT WINAPI d3d8_surface_GetContainer(IDirect3DSurface8 *iface, REFIID
static HRESULT WINAPI d3d8_surface_GetDesc(IDirect3DSurface8 *iface, D3DSURFACE_DESC *desc)
{
struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface);
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *sub_resource;
struct wined3d_sub_resource_desc wined3d_desc;
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
sub_resource = wined3d_texture_get_sub_resource(surface->wined3d_texture, surface->sub_resource_idx);
wined3d_resource_get_desc(sub_resource, &wined3d_desc);
wined3d_texture_get_sub_resource_desc(surface->wined3d_texture, surface->sub_resource_idx, &wined3d_desc);
wined3d_mutex_unlock();
desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
desc->Type = wined3d_desc.resource_type;
desc->Type = D3DRTYPE_SURFACE;
desc->Usage = wined3d_desc.usage & WINED3DUSAGE_MASK;
desc->Pool = wined3d_desc.pool;
desc->Size = wined3d_desc.size;