diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 57fe368a48..4b739fa222 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -167,6 +167,7 @@ struct VideoConfig bool bSupportsGLSLCache; bool bSupportsGLPinnedMemory; bool bSupportsGLSync; + bool bSupportsGLBaseVertex; } backend_info; // Utility diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 3196ad0886..642aa758b4 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -239,13 +239,6 @@ Renderer::Renderer() bSuccess = false; } - if (!GLEW_ARB_draw_elements_base_vertex) - { - ERROR_LOG(VIDEO, "GPU: OGL ERROR: Need GL_ARB_draw_elements_base_vertex.\n" - "GPU: Does your video card support OpenGL 3.2?"); - bSuccess = false; - } - if (!GLEW_ARB_sampler_objects) { ERROR_LOG(VIDEO, "GPU: OGL ERROR: Need GL_ARB_sampler_objects."); @@ -255,25 +248,25 @@ Renderer::Renderer() s_bHaveCoverageMSAA = GLEW_NV_framebuffer_multisample_coverage; g_Config.backend_info.bSupportsDualSourceBlend = GLEW_ARB_blend_func_extended; - g_Config.backend_info.bSupportsGLSLUBO = GLEW_ARB_uniform_buffer_object; - g_Config.backend_info.bSupportsGLPinnedMemory = GLEW_AMD_pinned_memory; - g_Config.backend_info.bSupportsGLSync = GLEW_ARB_sync; - g_Config.backend_info.bSupportsGLSLCache = GLEW_ARB_get_program_binary; + g_Config.backend_info.bSupportsGLBaseVertex = GLEW_ARB_draw_elements_base_vertex; UpdateActiveConfig(); - OSD::AddMessage(StringFromFormat("Supports: %s%s%s%s- Missing: %s%s%s%s", + OSD::AddMessage(StringFromFormat("Supports: %s%s%s%s%s- Missing: %s%s%s%s%s", g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "DualSourceBlend " : "", g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "UniformBuffer " : "", g_ActiveConfig.backend_info.bSupportsGLPinnedMemory ? "PinnedMemory " : "", g_ActiveConfig.backend_info.bSupportsGLSLCache ? "ShaderCache " : "", + g_ActiveConfig.backend_info.bSupportsGLBaseVertex ? "BaseVertex " : "", + g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ", g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "UniformBuffer ", g_ActiveConfig.backend_info.bSupportsGLPinnedMemory ? "" : "PinnedMemory ", - g_ActiveConfig.backend_info.bSupportsGLSLCache ? "" : "ShaderCache " + g_ActiveConfig.backend_info.bSupportsGLSLCache ? "" : "ShaderCache ", + g_ActiveConfig.backend_info.bSupportsGLBaseVertex ? "" : "BaseVertex " ).c_str(), 5000); s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp index 49e78a2463..578864e4b8 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp @@ -39,7 +39,9 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType) if(m_uploadtype == STREAM_DETECT) { - if(g_Config.backend_info.bSupportsGLSync && g_Config.backend_info.bSupportsGLPinnedMemory) + if(!g_Config.backend_info.bSupportsGLBaseVertex) + m_uploadtype = BUFFERSUBDATA; + else if(g_Config.backend_info.bSupportsGLSync && g_Config.backend_info.bSupportsGLPinnedMemory) m_uploadtype = PINNED_MEMORY; else if(g_Config.backend_info.bSupportsGLSync && g_Config.bHackedBufferUpload) m_uploadtype = MAP_AND_RISK; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index b17d19ff85..82bffd8dea 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -122,20 +122,38 @@ void VertexManager::Draw(u32 stride) u32 triangle_index_size = IndexGenerator::GetTriangleindexLen(); u32 line_index_size = IndexGenerator::GetLineindexLen(); u32 point_index_size = IndexGenerator::GetPointindexLen(); - if (triangle_index_size > 0) - { - glDrawElementsBaseVertex(GL_TRIANGLES, triangle_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[0], s_baseVertex); - INCSTAT(stats.thisFrame.numIndexedDrawCalls); - } - if (line_index_size > 0) - { - glDrawElementsBaseVertex(GL_LINES, line_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[1], s_baseVertex); - INCSTAT(stats.thisFrame.numIndexedDrawCalls); - } - if (point_index_size > 0) - { - glDrawElementsBaseVertex(GL_POINTS, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2], s_baseVertex); - INCSTAT(stats.thisFrame.numIndexedDrawCalls); + if(g_Config.backend_info.bSupportsGLBaseVertex) { + if (triangle_index_size > 0) + { + glDrawElementsBaseVertex(GL_TRIANGLES, triangle_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[0], s_baseVertex); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } + if (line_index_size > 0) + { + glDrawElementsBaseVertex(GL_LINES, line_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[1], s_baseVertex); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } + if (point_index_size > 0) + { + glDrawElementsBaseVertex(GL_POINTS, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2], s_baseVertex); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } + } else { + if (triangle_index_size > 0) + { + glDrawElements(GL_TRIANGLES, triangle_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[0]); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } + if (line_index_size > 0) + { + glDrawElements(GL_LINES, line_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[1]); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } + if (point_index_size > 0) + { + glDrawElements(GL_POINTS, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2]); + INCSTAT(stats.thisFrame.numIndexedDrawCalls); + } } }