Work around AMD's broken Linux drivers when it comes to pinned memory and base_vertex usage. It seems that using pinned memory with base_vertex disabled is quicker than the other way around.

This commit is contained in:
Ryan Houdek
2013-12-19 09:40:13 -06:00
parent a35b62358a
commit 945b903499
4 changed files with 18 additions and 14 deletions

View File

@ -476,7 +476,8 @@ Renderer::Renderer()
g_ogl_config.bSupportsGLSLCache = TO_BOOL(GLEW_ARB_get_program_binary);
g_ogl_config.bSupportsGLPinnedMemory = TO_BOOL(GLEW_AMD_pinned_memory);
g_ogl_config.bSupportsGLSync = TO_BOOL(GLEW_ARB_sync);
g_ogl_config.bSupportsGLBaseVertex = TO_BOOL(GLEW_ARB_draw_elements_base_vertex);
g_ogl_config.bSupportsGLBaseVertex = TO_BOOL(GLEW_ARB_draw_elements_base_vertex) &&
!DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY);
g_ogl_config.bSupportCoverageMSAA = TO_BOOL(GLEW_NV_framebuffer_multisample_coverage);
g_ogl_config.bSupportSampleShading = TO_BOOL(GLEW_ARB_sample_shading);
g_ogl_config.bSupportOGL31 = TO_BOOL(GLEW_VERSION_3_1);

View File

@ -40,7 +40,7 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
m_uploadtype = BUFFERDATA;
else if(g_ogl_config.bSupportsGLSync && g_ActiveConfig.bHackedBufferUpload && (m_uploadtype & MAP_AND_RISK))
m_uploadtype = MAP_AND_RISK;
else if(g_ogl_config.bSupportsGLSync && g_ogl_config.bSupportsGLPinnedMemory && !(DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) && type == GL_ELEMENT_ARRAY_BUFFER) && (m_uploadtype & PINNED_MEMORY))
else if(g_ogl_config.bSupportsGLSync && g_ogl_config.bSupportsGLPinnedMemory && (m_uploadtype & PINNED_MEMORY))
m_uploadtype = PINNED_MEMORY;
else if(nvidia && (m_uploadtype & BUFFERSUBDATA))
m_uploadtype = BUFFERSUBDATA;