Commit 583255f2 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Use correct layer count for 3D textures.

Fixes a regression introduced by commit 9ffacc43. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c08da43d
......@@ -422,7 +422,7 @@ void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view
struct wined3d_context *context, DWORD location)
{
struct wined3d_resource *resource = view->resource;
unsigned int i, sub_resource_idx;
unsigned int i, sub_resource_idx, layer_count;
struct wined3d_texture *texture;
if (resource->type == WINED3D_RTYPE_BUFFER)
......@@ -433,7 +433,8 @@ void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view
texture = texture_from_resource(resource);
sub_resource_idx = view->sub_resource_idx;
for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
}
......@@ -441,7 +442,7 @@ void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *v
struct wined3d_context *context, DWORD location)
{
struct wined3d_resource *resource = view->resource;
unsigned int i, sub_resource_idx;
unsigned int i, sub_resource_idx, layer_count;
struct wined3d_texture *texture;
if (resource->type == WINED3D_RTYPE_BUFFER)
......@@ -452,14 +453,15 @@ void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *v
texture = texture_from_resource(resource);
sub_resource_idx = view->sub_resource_idx;
for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
wined3d_texture_load_location(texture, sub_resource_idx, context, location);
}
void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, DWORD location)
{
struct wined3d_resource *resource = view->resource;
unsigned int i, sub_resource_idx;
unsigned int i, sub_resource_idx, layer_count;
struct wined3d_texture *texture;
if (resource->type == WINED3D_RTYPE_BUFFER)
......@@ -470,7 +472,8 @@ void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_vie
texture = texture_from_resource(resource);
sub_resource_idx = view->sub_resource_idx;
for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
wined3d_texture_validate_location(texture, sub_resource_idx, location);
}
......
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