Commit 691086ea authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Introduce wined3d_texture_get_sub_resource_parent().

parent 4f909e98
......@@ -1485,6 +1485,21 @@ HRESULT CDECL wined3d_texture_update_overlay(struct wined3d_texture *texture, un
return WINED3D_OK;
}
void * CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
unsigned int sub_count = texture->level_count * texture->layer_count;
TRACE("texture %p, sub_resource_idx %u.\n", texture, sub_resource_idx);
if (sub_resource_idx >= sub_count)
{
WARN("sub_resource_idx %u >= sub_count %u.\n", sub_resource_idx, sub_count);
return NULL;
}
return texture->sub_resources[sub_resource_idx].resource->parent;
}
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc,
UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent,
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
......
......@@ -251,6 +251,7 @@
@ 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_parent(ptr long)
@ cdecl wined3d_texture_incref(ptr)
@ cdecl wined3d_texture_preload(ptr)
@ cdecl wined3d_texture_release_dc(ptr long ptr)
......
......@@ -2447,6 +2447,7 @@ void __cdecl wined3d_texture_get_pitch(const struct wined3d_texture *texture,
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);
void * __cdecl wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx);
ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture);
void __cdecl wined3d_texture_preload(struct wined3d_texture *texture);
HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc);
......
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