--- dlls/wined3d/texture.c | 29 +++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 2 ++ include/wine/wined3d.h | 3 +++ 3 files changed, 34 insertions(+)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b369809..21cd262 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1465,3 +1465,32 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
return WINED3D_OK; } + +HRESULT CDECL wined3d_texture_sub_resource_map(struct wined3d_texture *texture, UINT sub_resource_idx, + struct wined3d_map_desc *map_desc, const void *rect_or_box, DWORD flags) +{ + struct wined3d_resource *sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx); + + if (!sub_resource) + return WINED3DERR_INVALIDCALL; + + if (texture->resource.type == WINED3D_RTYPE_VOLUME_TEXTURE) + return wined3d_volume_map(wined3d_volume_from_resource(sub_resource), + map_desc, (const struct wined3d_box *)rect_or_box, flags); + else + return wined3d_surface_map(wined3d_surface_from_resource(sub_resource), + map_desc, (const RECT *)rect_or_box, flags); +} + +HRESULT CDECL wined3d_texture_sub_resource_unmap(struct wined3d_texture *texture, UINT sub_resource_idx) +{ + struct wined3d_resource *sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx); + + if (!sub_resource) + return WINED3DERR_INVALIDCALL; + + if (texture->resource.type == WINED3D_RTYPE_VOLUME_TEXTURE) + return wined3d_volume_unmap(wined3d_volume_from_resource(sub_resource)); + else + return wined3d_surface_unmap(wined3d_surface_from_resource(sub_resource)); +} diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9531dd3..4c2dd9e 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -273,6 +273,8 @@ @ cdecl wined3d_texture_set_autogen_filter_type(ptr long) @ cdecl wined3d_texture_set_color_key(ptr long ptr) @ cdecl wined3d_texture_set_lod(ptr long) +@ cdecl wined3d_texture_sub_resource_map(ptr long ptr ptr long) +@ cdecl wined3d_texture_sub_resource_unmap(ptr long) @ cdecl wined3d_texture_update_desc(ptr long long long long long ptr long)
@ cdecl wined3d_vertex_declaration_create(ptr ptr long ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 00d666c..e8d99e7 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2551,6 +2551,9 @@ HRESULT __cdecl wined3d_texture_set_autogen_filter_type(struct wined3d_texture * HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture, DWORD flags, const struct wined3d_color_key *color_key); DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod); +HRESULT __cdecl wined3d_texture_sub_resource_map(struct wined3d_texture *texture, UINT sub_resource_idx, + struct wined3d_map_desc *map_desc, const void *rect_or_box, DWORD flags); +HRESULT __cdecl wined3d_texture_sub_resource_unmap(struct wined3d_texture *texture, UINT sub_resource_idx); HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT multisample_quality,