wined3d: Make wined3d_texture_update_map_binding() backend-independent.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jan Sikorski 2021-09-10 15:58:37 +02:00 committed by Alexandre Julliard
parent 1d46e601ff
commit 8e40f98c3e
1 changed files with 9 additions and 8 deletions

View File

@ -859,6 +859,12 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_BUFFER);
}
static void wined3d_texture_unload_location(struct wined3d_texture *texture,
struct wined3d_context *context, unsigned int location)
{
texture->texture_ops->texture_unload_location(texture, context, location);
}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
{
unsigned int sub_count = texture->level_count * texture->layer_count;
@ -874,10 +880,11 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
if (texture->sub_resources[i].locations == texture->resource.map_binding
&& !wined3d_texture_load_location(texture, i, context, map_binding))
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
wined3d_texture_remove_buffer_object(texture, i, wined3d_context_gl(context));
}
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
wined3d_texture_unload_location(texture, context, WINED3D_LOCATION_BUFFER);
context_release(context);
texture->resource.map_binding = map_binding;
@ -2110,12 +2117,6 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture,
return texture->texture_ops->texture_prepare_location(texture, sub_resource_idx, context, location);
}
static void wined3d_texture_unload_location(struct wined3d_texture *texture,
struct wined3d_context *context, unsigned int location)
{
texture->texture_ops->texture_unload_location(texture, context, location);
}
static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
unsigned int sub_resource_idx)
{