From adca879fb910d128e24dbcfe9990d15dbac4095e Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 15 May 2018 19:23:57 +1000 Subject: [PATCH] [opengl] use a single contiguous buffer for the AMD pinned buffer --- client/renderers/opengl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/renderers/opengl.c b/client/renderers/opengl.c index 323cf44c..02843435 100644 --- a/client/renderers/opengl.c +++ b/client/renderers/opengl.c @@ -35,7 +35,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include "utils.h" #include "lg-decoders.h" -#define BUFFER_COUNT 2 +#define BUFFER_COUNT 4 #define FPS_TEXTURE 0 #define MOUSE_TEXTURE 1 @@ -649,6 +649,10 @@ static bool configure(struct Inst * this, SDL_Window *window) if (this->amdPinnedMemSupport) { const int pagesize = getpagesize(); + this->texPixels[0] = memalign(pagesize, this->texSize * BUFFER_COUNT); + for(int i = 1; i < BUFFER_COUNT; ++i) + this->texPixels[i] = this->texPixels[0] + this->texSize; + for(int i = 0; i < BUFFER_COUNT; ++i) { glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, this->vboID[i]); @@ -658,7 +662,6 @@ static bool configure(struct Inst * this, SDL_Window *window) return false; } - this->texPixels[i] = memalign(pagesize, this->texSize); glBufferData( GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, this->texSize,