Module: wine Branch: master Commit: 93b8b6375ff630a4def6aa381bca51771d6fcf98 URL: https://gitlab.winehq.org/wine/wine/-/commit/93b8b6375ff630a4def6aa381bca517...
Author: Zebediah Figura zfigura@codeweavers.com Date: Sun Jul 10 15:30:45 2022 -0500
wined3d: Respect the client map count even for suballocated BOs.
I believe this was a mistake introduced by 831ff102008e2ba93a403344646b5ed67258eaeb.
This fixes GL errors with multiple applications, including Ragnarok Online and Bloodrayne: Terminal Cut.
---
dlls/wined3d/context_gl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 52a75c3d5ea..0d80aa8596f 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2944,15 +2944,6 @@ static void wined3d_bo_gl_unmap(struct wined3d_bo_gl *bo, struct wined3d_context return; }
- if (bo->memory) - { - struct wined3d_allocator_chunk_gl *chunk_gl = wined3d_allocator_chunk_gl(bo->memory->chunk); - - wined3d_allocator_chunk_gl_unmap(chunk_gl, context_gl); - bo->b.map_ptr = NULL; - return; - } - wined3d_device_bo_map_lock(context_gl->c.device); /* The mapping is still in use by the client (viz. for an accelerated * NOOVERWRITE map). The client will trigger another unmap request when the @@ -2967,6 +2958,14 @@ static void wined3d_bo_gl_unmap(struct wined3d_bo_gl *bo, struct wined3d_context bo->b.map_ptr = NULL; wined3d_device_bo_map_unlock(context_gl->c.device);
+ if (bo->memory) + { + struct wined3d_allocator_chunk_gl *chunk_gl = wined3d_allocator_chunk_gl(bo->memory->chunk); + + wined3d_allocator_chunk_gl_unmap(chunk_gl, context_gl); + return; + } + wined3d_context_gl_bind_bo(context_gl, bo->binding, bo->id); GL_EXTCALL(glUnmapBuffer(bo->binding)); wined3d_context_gl_bind_bo(context_gl, bo->binding, 0);