d3d9: Use wined3d_texture_get_sub_resource_desc() in d3d9_texture_3d_GetLevelDesc().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-03-02 19:24:12 +01:00 committed by Alexandre Julliard
parent 2281a7bd7c
commit 9f51e8f77e
5 changed files with 7 additions and 13 deletions

View file

@ -1077,21 +1077,16 @@ static void WINAPI d3d9_texture_3d_GenerateMipSubLevels(IDirect3DVolumeTexture9
static HRESULT WINAPI d3d9_texture_3d_GetLevelDesc(IDirect3DVolumeTexture9 *iface, UINT level, D3DVOLUME_DESC *desc)
{
struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(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_VOLUME;
desc->Usage = wined3d_desc.usage & WINED3DUSAGE_MASK;
desc->Pool = wined3d_desc.pool;
desc->Width = wined3d_desc.width;

View file

@ -716,7 +716,7 @@ void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture)
FIXME("texture %p stub!\n", texture);
}
struct wined3d_resource * CDECL wined3d_texture_get_sub_resource(const struct wined3d_texture *texture,
struct wined3d_resource *wined3d_texture_get_sub_resource(const struct wined3d_texture *texture,
UINT sub_resource_idx)
{
UINT sub_count = texture->level_count * texture->layer_count;

View file

@ -250,7 +250,6 @@
@ cdecl wined3d_texture_get_parent(ptr)
@ cdecl wined3d_texture_get_pitch(ptr long ptr ptr)
@ cdecl wined3d_texture_get_resource(ptr)
@ cdecl wined3d_texture_get_sub_resource(ptr long)
@ cdecl wined3d_texture_get_sub_resource_desc(ptr long ptr)
@ cdecl wined3d_texture_get_sub_resource_parent(ptr long)
@ cdecl wined3d_texture_incref(ptr)

View file

@ -2409,6 +2409,8 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
void wined3d_texture_force_reload(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_texture_get_sub_resource(const struct wined3d_texture *texture,
UINT sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,

View file

@ -2448,8 +2448,6 @@ void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture)
void __cdecl wined3d_texture_get_pitch(const struct wined3d_texture *texture,
unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch);
struct wined3d_resource * __cdecl wined3d_texture_get_resource(struct wined3d_texture *texture);
struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(const struct wined3d_texture *texture,
UINT sub_resource_idx);
HRESULT __cdecl wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture,
unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc);
void * __cdecl wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx);