[PATCH 0/1] MR9462: opengl32: Use Vulkan-backed buffer storage only when GL_MAP_PERSISTENT_BIT is specified.
Non-persistent mappings have additional synchronization guarantees on map that are hard to emulate with Vulkan. Fall back to the memcpy code path instead. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9462
From: Jacek Caban <jacek(a)codeweavers.com> Non-persistent mappings have additional synchronization guarantees on map that are hard to emulate with Vulkan. Fall back to the memcpy code path instead. --- dlls/opengl32/unix_wgl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 085df429202..4cb68511b6a 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -2421,6 +2421,7 @@ static struct buffer *create_buffer_storage( TEB *teb, GLenum target, GLuint nam int fd, memory_type; VkResult vr; + if (!(flags & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT))) return NULL; if (!(vk_device = ctx->buffers->vk_device) || !vk_device->vk_device) return NULL; if (flags & GL_CLIENT_STORAGE_BIT) desired_type &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; @@ -2619,7 +2620,7 @@ void wow64_glBufferStorage( TEB *teb, GLenum target, GLsizeiptr size, const void const struct opengl_funcs *funcs = teb->glTable; struct buffer *buffer = NULL; - if (flags & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) + if (flags & GL_MAP_PERSISTENT_BIT) buffer = create_buffer_storage( teb, target, 0, size, data, flags ); if (!buffer) funcs->p_glBufferStorage( target, size, data, flags ); @@ -2630,7 +2631,7 @@ void wow64_glNamedBufferStorage( TEB *teb, GLuint name, GLsizeiptr size, const v const struct opengl_funcs *funcs = teb->glTable; struct buffer *buffer = NULL; - if (flags & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) + if (flags & GL_MAP_PERSISTENT_BIT) buffer = create_buffer_storage( teb, 0, name, size, data, flags ); if (!buffer) funcs->p_glNamedBufferStorage( name, size, data, flags ); @@ -2641,7 +2642,7 @@ void wow64_glNamedBufferStorageEXT( TEB *teb, GLuint name, GLsizeiptr size, cons const struct opengl_funcs *funcs = teb->glTable; struct buffer *buffer = NULL; - if (flags & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) + if (flags & GL_MAP_PERSISTENT_BIT) buffer = create_buffer_storage( teb, 0, name, size, data, flags ); if (!buffer) funcs->p_glNamedBufferStorageEXT( name, size, data, flags ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9462
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9462
participants (3)
-
Jacek Caban -
Jacek Caban (@jacek) -
Rémi Bernon