From 1d86dafbe26f8f19ba8e3958076503c17aa5ab8f Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 5 Feb 2013 00:53:14 +0100 Subject: [PATCH] evil hack: map the buffer once and use this pointer after unmaping This isn't allowed by gl and may _only_ work, if the driver uses cpu bound buffer. But it may speed up :-) --- .../Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp | 15 ++++++++++++++- Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp index d27aafb69f..1f4f8f50b0 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp @@ -41,7 +41,7 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType) if(g_Config.backend_info.bSupportsGLPinnedMemory) m_uploadtype = PINNED_MEMORY; else - m_uploadtype = MAP_AND_SYNC; + m_uploadtype = MAP_AND_RISK; } Init(); @@ -73,6 +73,7 @@ void StreamBuffer::Alloc ( size_t size, u32 stride ) break; case MAP_AND_SYNC: case PINNED_MEMORY: + case MAP_AND_RISK: // insert waiting slots for used memory for(u32 i=SLOT(m_used_iterator); i