From 8e40f98c3ed1a657c21ea2e066fd61e0661c947e Mon Sep 17 00:00:00 2001 From: Jan Sikorski Date: Fri, 10 Sep 2021 15:58:37 +0200 Subject: [PATCH] wined3d: Make wined3d_texture_update_map_binding() backend-independent. Signed-off-by: Jan Sikorski Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/texture.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 08b57cf1a36..d38bfedddb8 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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) {