summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/StreamBuffer.cpp
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2014-03-11 00:30:55 +1300
committerMatthew Parlane <parlane@gmail.com>2014-03-11 00:35:07 +1300
commit31cfc73a09a8685cbab20502b4bc132e98e2feb5 (patch)
treec7eb3a0906bab0eb711bd7c79166c96fe97ec488 /Source/Core/VideoBackends/OGL/StreamBuffer.cpp
parent4591464486d696a300cc914f6c2a3cce8af2d666 (diff)
Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/StreamBuffer.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/StreamBuffer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp
index be7f4eeacd..03d9d71de3 100644
--- a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp
+++ b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp
@@ -66,7 +66,7 @@ static const u32 SYNC_POINTS = 16;
void StreamBuffer::CreateFences()
{
fences = new GLsync[SYNC_POINTS];
- for(u32 i=0; i<SYNC_POINTS; i++)
+ for (u32 i=0; i<SYNC_POINTS; i++)
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
}
void StreamBuffer::DeleteFences()
@@ -123,7 +123,7 @@ void StreamBuffer::AllocMemory(size_t size)
void StreamBuffer::Align(u32 stride)
{
- if(m_iterator && stride) {
+ if (m_iterator && stride) {
m_iterator--;
m_iterator = m_iterator - (m_iterator % stride) + stride;
}
@@ -149,7 +149,7 @@ public:
std::pair<u8*, size_t> Map(size_t size, u32 stride) override {
Align(stride);
- if(m_iterator + size >= m_size) {
+ if (m_iterator + size >= m_size) {
glBufferData(m_buffertype, m_size, nullptr, GL_STREAM_DRAW);
m_iterator = 0;
}
@@ -350,9 +350,9 @@ public:
StreamBuffer* StreamBuffer::Create(u32 type, size_t size)
{
// without basevertex support, only streaming methods whith uploads everything to zero works fine:
- if(!g_ogl_config.bSupportsGLBaseVertex)
+ if (!g_ogl_config.bSupportsGLBaseVertex)
{
- if(!DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTREAM))
+ if (!DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTREAM))
return new BufferSubData(type, size);
// BufferData is by far the worst way, only use it if needed
@@ -360,7 +360,7 @@ StreamBuffer* StreamBuffer::Create(u32 type, size_t size)
}
// Prefer the syncing buffers over the orphaning one
- if(g_ogl_config.bSupportsGLSync)
+ if (g_ogl_config.bSupportsGLSync)
{
// try to use buffer storage whenever possible
if (g_ogl_config.bSupportsGLBufferStorage &&
@@ -368,16 +368,16 @@ StreamBuffer* StreamBuffer::Create(u32 type, size_t size)
return new BufferStorage(type, size);
// pinned memory is almost as fine
- if(g_ogl_config.bSupportsGLPinnedMemory &&
+ if (g_ogl_config.bSupportsGLPinnedMemory &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) && type == GL_ELEMENT_ARRAY_BUFFER))
return new PinnedMemory(type, size);
// don't fall back to MapAnd* for nvidia drivers
- if(DriverDetails::HasBug(DriverDetails::BUG_BROKENUNSYNCMAPPING))
+ if (DriverDetails::HasBug(DriverDetails::BUG_BROKENUNSYNCMAPPING))
return new BufferSubData(type, size);
// mapping fallback
- if(g_ogl_config.bSupportsGLSync)
+ if (g_ogl_config.bSupportsGLSync)
return new MapAndSync(type, size);
}