From 50f4bf114ed0dcd1932e91c13ab64b37d0413772 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 19 Feb 2013 15:51:48 +0100 Subject: [PATCH] Revert "map_orphan_and_risk - next try for upload method" This reverts commit 17747fcfb8a4f076ea97d8d5781539735ab32f72. On orphaning, some gl drivers do heurisitics where to store the buffer. As the hack may only work on pinned memory, it would be much less deteministic. --- .../Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp | 16 ++++------------ .../Plugins/Plugin_VideoOGL/Src/StreamBuffer.h | 1 - 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp index cfd7eb08bc..9ef43f6d53 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp @@ -40,8 +40,10 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType) { if(g_Config.backend_info.bSupportsGLPinnedMemory && g_Config.backend_info.bSupportsGLSync) m_uploadtype = PINNED_MEMORY; + else if(g_Config.backend_info.bSupportsGLSync) + m_uploadtype = MAP_AND_RISK; else - m_uploadtype = MAP_ORPAN_AND_RISK; + m_uploadtype = MAP_AND_ORPHAN; } Init(); @@ -71,14 +73,6 @@ void StreamBuffer::Alloc ( size_t size, u32 stride ) m_iterator_aligned = 0; } break; - case MAP_ORPAN_AND_RISK: - if(iter_end >= m_size) { - glBufferData(m_buffertype, m_size, NULL, GL_STREAM_DRAW); - m_iterator_aligned = 0; - pointer = (u8*)glMapBufferRange(m_buffertype, 0, m_size, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT); - glUnmapBuffer(m_buffertype); - } - break; case MAP_AND_SYNC: case PINNED_MEMORY: case MAP_AND_RISK: @@ -143,7 +137,6 @@ size_t StreamBuffer::Upload ( u8* data, size_t size ) break; case PINNED_MEMORY: case MAP_AND_RISK: - case MAP_ORPAN_AND_RISK: if(pointer) memcpy(pointer+m_iterator, data, size); break; @@ -190,7 +183,7 @@ void StreamBuffer::Init() fences = new GLsync[SYNC_POINTS]; for(u32 i=0; i