From 258b73409ca393bfd3ce9d8966dd88a34a90d6ce Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 23 Apr 2015 21:10:43 +0200 Subject: [PATCH] gsdx-ogl: update flags for buffer storage Fix issue with Mesa driver --- plugins/GSdx/GSTextureOGL.cpp | 6 +++--- plugins/GSdx/GSVertexArrayOGL.h | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index ee0b8ed164..abd707be2e 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -45,9 +45,9 @@ namespace PboPool { // XXX: actually does I really need coherent and barrier??? // As far as I understand glTexSubImage2D is a client-server transfer so no need to make // the value visible to the server - const GLbitfield map_flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT /*| GL_MAP_COHERENT_BIT*/; - // FIXME do I need GL_DYNAMIC_STORAGE_BIT to allow write? - const GLbitfield create_flags = map_flags /*| GL_DYNAMIC_STORAGE_BIT*/ | GL_CLIENT_STORAGE_BIT; + const GLbitfield common_flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT; + const GLbitfield map_flags = common_flags | GL_MAP_FLUSH_EXPLICIT_BIT; + const GLbitfield create_flags = common_flags | GL_CLIENT_STORAGE_BIT; #endif void Init() { diff --git a/plugins/GSdx/GSVertexArrayOGL.h b/plugins/GSdx/GSVertexArrayOGL.h index 276cde2c76..81bdc07620 100644 --- a/plugins/GSdx/GSVertexArrayOGL.h +++ b/plugins/GSdx/GSVertexArrayOGL.h @@ -62,13 +62,10 @@ class GSBufferOGL { if (m_buffer_storage) { #ifndef ENABLE_GLES bind(); - // FIXME do I need the dynamic - const GLbitfield map_flags = GL_MAP_WRITE_BIT - | GL_MAP_PERSISTENT_BIT - // | GL_MAP_COHERENT_BIT (see barrier in GSDeviceOGL::BeforeDraw) - | GL_MAP_FLUSH_EXPLICIT_BIT - ; - const GLbitfield create_flags = map_flags + // coherency will be done by flushing + const GLbitfield common_flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT; + const GLbitfield map_flags = common_flags | GL_MAP_FLUSH_EXPLICIT_BIT; + const GLbitfield create_flags = common_flags // | GL_CLIENT_STORAGE_BIT ;