Place pinned memory as top priority

This commit is contained in:
Justin Chadwick 2014-07-03 20:35:13 -04:00
parent be1fe80bb6
commit 30f93ab418
1 changed files with 6 additions and 6 deletions

View File

@ -346,16 +346,16 @@ StreamBuffer* StreamBuffer::Create(u32 type, u32 size)
// Prefer the syncing buffers over the orphaning one // 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 // pinned memory is much faster on amd cards
if (g_ogl_config.bSupportsGLBufferStorage &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && type == GL_ARRAY_BUFFER))
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)) !(DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) && type == GL_ELEMENT_ARRAY_BUFFER))
return new PinnedMemory(type, size); return new PinnedMemory(type, size);
// buffer storage works well in most situations
if (g_ogl_config.bSupportsGLBufferStorage &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && type == GL_ARRAY_BUFFER))
return new BufferStorage(type, size);
// don't fall back to MapAnd* for nvidia drivers // 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); return new BufferSubData(type, size);