Commit 7fc43d3c authored by Riccardo Bortolato's avatar Riccardo Bortolato Committed by Alexandre Julliard

d3d8: Use wined3d_rendertarget_view_create instead of…

d3d8: Use wined3d_rendertarget_view_create instead of wined3d_rendertarget_view_create_from_surface in d3d8_surface_get_rendertarget_view. Signed-off-by: 's avatarRiccardo Bortolato <rikyz619@gmail.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bef3298e
......@@ -348,12 +348,23 @@ static const struct wined3d_parent_ops d3d8_view_wined3d_parent_ops =
struct wined3d_rendertarget_view *d3d8_surface_get_rendertarget_view(struct d3d8_surface *surface)
{
struct wined3d_resource *resource;
struct wined3d_resource_desc resource_desc;
struct wined3d_rendertarget_view_desc desc;
HRESULT hr;
if (surface->wined3d_rtv)
return surface->wined3d_rtv;
if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface,
resource = wined3d_texture_get_resource(surface->wined3d_texture);
wined3d_resource_get_desc(resource, &resource_desc);
desc.format_id = resource_desc.format;
desc.u.texture.level_idx = surface->sub_resource_idx;
desc.u.texture.layer_idx = 0;
desc.u.texture.layer_count = 1;
if (FAILED(hr = wined3d_rendertarget_view_create(&desc, resource,
surface, &d3d8_view_wined3d_parent_ops, &surface->wined3d_rtv)))
{
ERR("Failed to create rendertarget view, hr %#x.\n", hr);
......
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