From 704a11e6d69cce67ce855ef2a8fa66725826eaf8 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 29 Feb 2016 18:19:26 +0100 Subject: [PATCH] d3d8: Use wined3d_texture_get_sub_resource_desc() in d3d8_texture_2d_GetLevelDesc(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d8/texture.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index bef099a7687..a1bf0abdce1 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -243,21 +243,16 @@ static DWORD WINAPI d3d8_texture_2d_GetLevelCount(IDirect3DTexture8 *iface) static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *sub_resource; - HRESULT hr = D3D_OK; + struct wined3d_sub_resource_desc wined3d_desc; + HRESULT hr; TRACE("iface %p, level %u, desc %p.\n", iface, level, desc); wined3d_mutex_lock(); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level))) - hr = D3DERR_INVALIDCALL; - else + if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc))) { - struct wined3d_resource_desc wined3d_desc; - - wined3d_resource_get_desc(sub_resource, &wined3d_desc); 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;