From 63982bf6b715d4adc9dbf1c0ed119e110161a8f5 Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Fri, 16 Aug 2019 15:45:11 +0200 Subject: [PATCH] GSdx-hw OGL: fix PBO pool map size. Round up mapping size for alignment before computing wrapped pointer. Avoids memcpy after end of PBO buffer. --- plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp index 0fed07d4ea..f0e871f0f3 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp +++ b/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp @@ -69,7 +69,8 @@ namespace PboPool { char* Map(uint32 size) { char* map; - m_size = size; + // Note: keep offset aligned for SSE/AVX + m_size = (size + 63) & ~0x3F; if (m_size > m_pbo_size) { fprintf(stderr, "BUG: PBO too small %u but need %u\n", m_pbo_size, m_size); @@ -142,8 +143,7 @@ namespace PboPool { } void EndTransfer() { - // Note: keep offset aligned for SSE/AVX - m_offset += (m_size + 63) & ~0x3F; + m_offset += m_size; } }