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.
This commit is contained in:
Alessandro Vetere 2019-08-16 15:45:11 +02:00 committed by lightningterror
parent 9788f6db2c
commit 63982bf6b7
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}