Henri Verbeet : wined3d: Handle GL_APPLE_flush_buffer_range flushing in wined3d_context_gl_unmap_bo_address().
Alexandre Julliard
julliard at winehq.org
Fri Dec 4 14:36:03 CST 2020
Module: wine
Branch: master
Commit: b2748a99fdd4ba9fd2c747d8a4ab11dc9b70b8ed
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b2748a99fdd4ba9fd2c747d8a4ab11dc9b70b8ed
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Dec 4 18:33:35 2020 +0330
wined3d: Handle GL_APPLE_flush_buffer_range flushing in wined3d_context_gl_unmap_bo_address().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/buffer.c | 27 ---------------------------
dlls/wined3d/context_gl.c | 9 +++++++++
2 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index c752b329a32..6ff6a5b6cd0 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -32,7 +32,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */
#define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */
#define WINED3D_BUFFER_PIN_SYSMEM 0x04 /* Keep a system memory copy for this buffer. */
-#define WINED3D_BUFFER_APPLESYNC 0x10 /* Using sync as in GL_APPLE_flush_buffer_range. */
#define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */
#define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */
@@ -160,8 +159,6 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu
list_remove(&buffer_gl->bo_user.entry);
wined3d_context_gl_destroy_bo(context_gl, &buffer_gl->bo);
buffer_gl->b.buffer_object = 0;
-
- buffer_gl->b.flags &= ~WINED3D_BUFFER_APPLESYNC;
}
/* Context activation is done by the caller. */
@@ -196,9 +193,6 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf
return FALSE;
}
- if (!coherent && gl_info->supported[APPLE_FLUSH_BUFFER_RANGE])
- buffer_gl->b.flags |= WINED3D_BUFFER_APPLESYNC;
-
list_init(&buffer_gl->bo_user.entry);
list_add_head(&buffer_gl->bo.users, &buffer_gl->bo_user.entry);
buffer_gl->b.buffer_object = (uintptr_t)bo;
@@ -988,27 +982,6 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou
context = context_acquire(device, NULL, 0);
- if (buffer->flags & WINED3D_BUFFER_APPLESYNC)
- {
- struct wined3d_context_gl *context_gl;
- const struct wined3d_gl_info *gl_info;
- struct wined3d_buffer_gl *buffer_gl;
- unsigned int i;
-
- buffer_gl = wined3d_buffer_gl(buffer);
- context_gl = wined3d_context_gl(context);
- gl_info = context_gl->gl_info;
-
- wined3d_buffer_gl_bind(buffer_gl, context_gl);
- for (i = 0; i < range_count; ++i)
- {
- GL_EXTCALL(glFlushMappedBufferRangeAPPLE(buffer_gl->bo.binding,
- buffer->maps[i].offset, buffer->maps[i].size));
- checkGLcall("glFlushMappedBufferRangeAPPLE");
- }
- range_count = 0;
- }
-
addr.buffer_object = buffer->buffer_object;
addr.addr = 0;
wined3d_context_unmap_bo_address(context, &addr, range_count, buffer->maps);
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index f2f6185ecc6..ea12778e292 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -2743,6 +2743,15 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl,
(UINT_PTR)data->addr + ranges[i].offset, ranges[i].size));
}
}
+ else if (!bo->coherent && gl_info->supported[APPLE_FLUSH_BUFFER_RANGE])
+ {
+ for (i = 0; i < range_count; ++i)
+ {
+ GL_EXTCALL(glFlushMappedBufferRangeAPPLE(bo->binding,
+ (uintptr_t)data->addr + ranges[i].offset, ranges[i].size));
+ checkGLcall("glFlushMappedBufferRangeAPPLE");
+ }
+ }
GL_EXTCALL(glUnmapBuffer(bo->binding));
wined3d_context_gl_bind_bo(context_gl, bo->binding, 0);
More information about the wine-cvs
mailing list