ddraw: Use wined3d_rendertarget_view_create_from_sub_resource() in ddraw_surface_get_rendertarget_view().

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-03 22:22:58 +01:00 committed by Alexandre Julliard
parent 1ff9660323
commit 6037179f6b
4 changed files with 2 additions and 20 deletions

View File

@ -6324,8 +6324,8 @@ struct wined3d_rendertarget_view *ddraw_surface_get_rendertarget_view(struct ddr
if (surface->wined3d_rtv) if (surface->wined3d_rtv)
return surface->wined3d_rtv; return surface->wined3d_rtv;
if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface, if (FAILED(hr = wined3d_rendertarget_view_create_from_sub_resource(surface->wined3d_texture,
surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv))) surface->sub_resource_idx, surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv)))
{ {
ERR("Failed to create rendertarget view, hr %#x.\n", hr); ERR("Failed to create rendertarget view, hr %#x.\n", hr);
return NULL; return NULL;

View File

@ -145,21 +145,6 @@ HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_rendertarget
return WINED3D_OK; return WINED3D_OK;
} }
HRESULT CDECL wined3d_rendertarget_view_create_from_surface(struct wined3d_surface *surface,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view)
{
struct wined3d_rendertarget_view_desc desc;
TRACE("surface %p, parent %p, parent_ops %p, view %p.\n", surface, parent, parent_ops, view);
desc.format_id = surface->resource.format->id;
desc.u.texture.level_idx = surface->texture_level;
desc.u.texture.layer_idx = surface->texture_layer;
desc.u.texture.layer_count = 1;
return wined3d_rendertarget_view_create(&desc, &surface->container->resource, parent, parent_ops, view);
}
HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture,
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view) struct wined3d_rendertarget_view **view)

View File

@ -188,7 +188,6 @@
@ cdecl wined3d_resource_unmap(ptr long) @ cdecl wined3d_resource_unmap(ptr long)
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_create_from_sub_resource(ptr long ptr ptr ptr) @ cdecl wined3d_rendertarget_view_create_from_sub_resource(ptr long ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_decref(ptr) @ cdecl wined3d_rendertarget_view_decref(ptr)
@ cdecl wined3d_rendertarget_view_get_parent(ptr) @ cdecl wined3d_rendertarget_view_get_parent(ptr)

View File

@ -2430,8 +2430,6 @@ HRESULT __cdecl wined3d_resource_unmap(struct wined3d_resource *resource, unsign
HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc,
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view); struct wined3d_rendertarget_view **view);
HRESULT __cdecl wined3d_rendertarget_view_create_from_surface(struct wined3d_surface *surface,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view);
HRESULT __cdecl wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, HRESULT __cdecl wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture,
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view); struct wined3d_rendertarget_view **view);