Commit 6037179f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Use wined3d_rendertarget_view_create_from_sub_resource() in…

ddraw: Use wined3d_rendertarget_view_create_from_sub_resource() in ddraw_surface_get_rendertarget_view(). Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1ff96603
......@@ -6324,8 +6324,8 @@ struct wined3d_rendertarget_view *ddraw_surface_get_rendertarget_view(struct ddr
if (surface->wined3d_rtv)
return surface->wined3d_rtv;
if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface,
surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv)))
if (FAILED(hr = wined3d_rendertarget_view_create_from_sub_resource(surface->wined3d_texture,
surface->sub_resource_idx, surface, &ddraw_view_wined3d_parent_ops, &surface->wined3d_rtv)))
{
ERR("Failed to create rendertarget view, hr %#x.\n", hr);
return NULL;
......
......@@ -145,21 +145,6 @@ HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_rendertarget
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,
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view)
......
......@@ -188,7 +188,6 @@
@ cdecl wined3d_resource_unmap(ptr long)
@ 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_decref(ptr)
@ cdecl wined3d_rendertarget_view_get_parent(ptr)
......
......@@ -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,
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
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,
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view);
......
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