From d4449971c949ddd988a0d615b42e17ff2f6202ef Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 12 Mar 2018 00:19:14 +0100 Subject: [PATCH 1/2] OGL: Warn if buffer_storage isn't available. Yes, this commit is only to blame OSX and Mali. Through the former supports unsynchronized mappings, the latter supports *no* way to stream dynamic data at all. Let's try to make bad news, as they ignore friendly feature requests. Maybe we just need to make more noise... --- Source/Core/VideoBackends/OGL/Render.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 8f2ca8a05c..02252117fd 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -730,6 +730,16 @@ Renderer::Renderer() g_ogl_config.gl_renderer, g_ogl_config.gl_version), 5000); + if (!g_ogl_config.bSupportsGLBufferStorage && !g_ogl_config.bSupportsGLPinnedMemory) + { + OSD::AddMessage( + StringFromFormat("Your OpenGL driver does not support %s_buffer_storage.", + GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3 ? "EXT" : "ARB"), + 60000); + OSD::AddMessage("This device's performance will be terrible.", 60000); + OSD::AddMessage("Please ask your device vendor for an updated OpenGL driver.", 60000); + } + WARN_LOG(VIDEO, "Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s%s%s%s%s", g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ", g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ", From a5c0739fabefed9478b37aae8ae3e1a00a7f772a Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 12 Mar 2018 00:34:46 +0100 Subject: [PATCH 2/2] OGL: Scale OSD text on big screens. --- Source/Core/VideoBackends/OGL/RasterFont.cpp | 1 + Source/Core/VideoBackends/OGL/Render.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/RasterFont.cpp b/Source/Core/VideoBackends/OGL/RasterFont.cpp index a90f3c3721..f21ac22900 100644 --- a/Source/Core/VideoBackends/OGL/RasterFont.cpp +++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp @@ -157,6 +157,7 @@ RasterFont::RasterFont() } } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHARACTER_WIDTH * CHARACTER_COUNT, CHARACTER_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data()); diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 02252117fd..a0c3bb6c8d 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -851,10 +851,17 @@ Renderer::CreateFramebuffer(const AbstractTexture* color_attachment, void Renderer::RenderText(const std::string& text, int left, int top, u32 color) { - s_raster_font->printMultilineText(text, - left * 2.0f / static_cast(m_backbuffer_width) - 1.0f, - 1.0f - top * 2.0f / static_cast(m_backbuffer_height), 0, - m_backbuffer_width, m_backbuffer_height, color); + int screen_width = m_backbuffer_width; + int screen_height = m_backbuffer_height; + if (screen_width >= 2000) + { + screen_width /= 2; + screen_height /= 2; + } + + s_raster_font->printMultilineText(text, left * 2.0f / static_cast(screen_width) - 1.0f, + 1.0f - top * 2.0f / static_cast(screen_height), 0, + screen_width, screen_height, color); } std::unique_ptr Renderer::CreateShaderFromSource(ShaderStage stage,