From c7d75ee437523b39256a82db2acceafe86ed626e Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 16 Mar 2013 10:08:46 +0100 Subject: [PATCH] GLSL: explicitly check for gl errors for pinned memory --- .../Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp index 616c3e7c08..843a126637 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp @@ -37,10 +37,10 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType) { if(!g_Config.backend_info.bSupportsGLBaseVertex) m_uploadtype = BUFFERSUBDATA; - else if(g_Config.backend_info.bSupportsGLSync && g_Config.backend_info.bSupportsGLPinnedMemory) - m_uploadtype = PINNED_MEMORY; else if(g_Config.backend_info.bSupportsGLSync && g_Config.bHackedBufferUpload) m_uploadtype = MAP_AND_RISK; + else if(g_Config.backend_info.bSupportsGLSync && g_Config.backend_info.bSupportsGLPinnedMemory) + m_uploadtype = PINNED_MEMORY; else if(nvidia) m_uploadtype = BUFFERSUBDATA; else if(g_Config.backend_info.bSupportsGLSync) @@ -176,15 +176,24 @@ void StreamBuffer::Init() glBufferData(m_buffertype, m_size, NULL, GL_STREAM_DRAW); break; case PINNED_MEMORY: + glGetError(); // errors before this allocation should be ignored fences = new GLsync[SYNC_POINTS]; for(u32 i=0; i