Commit 8f1cf93b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Simplify wined3d_rendertarget_view_create_from_sub_resource().

parent 44f2589e
......@@ -164,22 +164,17 @@ HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_rendertarget_view **view)
{
struct wined3d_resource *sub_resource;
struct wined3d_rendertarget_view_desc desc;
TRACE("texture %p, sub_resource_idx %u, parent %p, parent_ops %p, view %p.\n",
texture, sub_resource_idx, parent, parent_ops, view);
if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)))
return WINED3DERR_INVALIDCALL;
if (sub_resource->type != WINED3D_RTYPE_SURFACE)
{
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(texture->resource.type));
return WINED3DERR_INVALIDCALL;
}
desc.format_id = texture->resource.format->id;
desc.u.texture.level_idx = sub_resource_idx % texture->level_count;
desc.u.texture.layer_idx = sub_resource_idx / texture->level_count;
desc.u.texture.layer_count = 1;
return wined3d_rendertarget_view_create_from_surface(surface_from_resource(sub_resource),
parent, parent_ops, view);
return wined3d_rendertarget_view_create(&desc, &texture->resource, parent, parent_ops, view);
}
ULONG CDECL wined3d_shader_resource_view_incref(struct wined3d_shader_resource_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