diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-11-21 21:17:58 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-11-21 21:17:58 -0600 |
| commit | ea9ac07ec9a920612425413fb4256519b827328f (patch) | |
| tree | c628b92f30fa3069b496031b40fc8a0ece5797fa /Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp | |
| parent | 1aa06b8fa4105d22cac0dd847230215099bbeb78 (diff) | |
| parent | ff917897731d400a8e71c1480425733e651126ee (diff) | |
Merge branch 'master' into jit_exit_addresses
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp index 9826033098..15135f3621 100644 --- a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp +++ b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp @@ -59,7 +59,7 @@ StreamBuffer::~StreamBuffer() glDeleteBuffers(1, &m_buffer); } -#define SLOT(x) (x)*SYNC_POINTS/m_size +#define SLOT(x) ((x)*SYNC_POINTS/m_size) void StreamBuffer::Alloc ( size_t size, u32 stride ) { @@ -81,14 +81,14 @@ void StreamBuffer::Alloc ( size_t size, u32 stride ) case PINNED_MEMORY: // insert waiting slots for used memory - for(u32 i=SLOT(m_used_iterator); i<SLOT(m_iterator); i++) + for(size_t i=SLOT(m_used_iterator); i<SLOT(m_iterator); i++) { fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); } m_used_iterator = m_iterator; // wait for new slots to end of buffer - for(u32 i=SLOT(m_free_iterator)+1; i<=SLOT(iter_end) && i < SYNC_POINTS; i++) + for (size_t i = SLOT(m_free_iterator) + 1; i <= SLOT(iter_end) && i < SYNC_POINTS; i++) { glClientWaitSync(fences[i], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED); glDeleteSync(fences[i]); @@ -99,8 +99,10 @@ void StreamBuffer::Alloc ( size_t size, u32 stride ) if(iter_end >= m_size) { // insert waiting slots in unused space at the end of the buffer - for(u32 i=SLOT(m_used_iterator); i < SYNC_POINTS; i++) + for (size_t i = SLOT(m_used_iterator); i < SYNC_POINTS; i++) + { fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + } // move to the start m_used_iterator = m_iterator_aligned = m_iterator = 0; // offset 0 is always aligned @@ -244,10 +246,14 @@ void StreamBuffer::Shutdown() void StreamBuffer::DeleteFences() { - for(u32 i=SLOT(m_free_iterator)+1; i < SYNC_POINTS; i++) + for (size_t i = SLOT(m_free_iterator) + 1; i < SYNC_POINTS; i++) + { glDeleteSync(fences[i]); - for(u32 i=0; i<SLOT(m_iterator); i++) + } + for (size_t i = 0; i < SLOT(m_iterator); i++) + { glDeleteSync(fences[i]); + } delete [] fences; } |
