On Tue, 10 Aug 2021 at 10:34, Jan Sikorski <jsikorski(a)codeweavers.com> wrote:
+static void wined3d_view_load_location(struct wined3d_resource *resource, + const struct wined3d_view_desc *desc, struct wined3d_context *context, DWORD location) +{ + unsigned int i, sub_resource_idx, layer_count; + struct wined3d_texture *texture; + + if (resource->type == WINED3D_RTYPE_BUFFER) + { + wined3d_buffer_load_location(buffer_from_resource(resource), context, location); + return; + } + + texture = texture_from_resource(resource); + sub_resource_idx = desc->u.texture.layer_idx * texture->level_count + desc->u.texture.level_idx; + layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? desc->u.texture.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); +} + As it is, this is unused, and would cause compiler warnings when applied. If we're going to have this helper, we'd probably want to use it from wined3d_rendertarget_view_load_location().