From 134d967be2dd4ba9531abb8ba8494c3ac423ca72 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:02:45 +1000 Subject: Refactoring and cleanup of GLInterface (now GLContext) --- Source/Core/VideoBackends/OGL/PerfQuery.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/PerfQuery.cpp') diff --git a/Source/Core/VideoBackends/OGL/PerfQuery.cpp b/Source/Core/VideoBackends/OGL/PerfQuery.cpp index b3b5df2265..30a6e1781b 100644 --- a/Source/Core/VideoBackends/OGL/PerfQuery.cpp +++ b/Source/Core/VideoBackends/OGL/PerfQuery.cpp @@ -6,7 +6,7 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" -#include "Common/GL/GLInterfaceBase.h" +#include "Common/GL/GLContext.h" #include "Common/GL/GLUtil.h" #include "VideoBackends/OGL/PerfQuery.h" @@ -17,11 +17,10 @@ namespace OGL { std::unique_ptr GetPerfQuery() { - if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3 && - GLExtensions::Supports("GL_NV_occlusion_query_samples")) + if (g_main_gl_context->IsGLES() && GLExtensions::Supports("GL_NV_occlusion_query_samples")) return std::make_unique(); - if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3) + if (g_main_gl_context->IsGLES()) return std::make_unique(GL_ANY_SAMPLES_PASSED); return std::make_unique(GL_SAMPLES_PASSED); @@ -266,4 +265,4 @@ void PerfQueryGLESNV::FlushResults() FlushOne(); } -} // namespace +} // namespace OGL -- cgit v1.2.3 From dcdd02d646230e7903520a41dc9f86e57ae16dbe Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:26 +1000 Subject: GLContext: Remove global context pointer --- Source/Core/VideoBackends/OGL/PerfQuery.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/PerfQuery.cpp') diff --git a/Source/Core/VideoBackends/OGL/PerfQuery.cpp b/Source/Core/VideoBackends/OGL/PerfQuery.cpp index 30a6e1781b..77471cee19 100644 --- a/Source/Core/VideoBackends/OGL/PerfQuery.cpp +++ b/Source/Core/VideoBackends/OGL/PerfQuery.cpp @@ -6,24 +6,23 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" -#include "Common/GL/GLContext.h" -#include "Common/GL/GLUtil.h" +#include "Common/GL/GLExtensions/GLExtensions.h" #include "VideoBackends/OGL/PerfQuery.h" -#include "VideoCommon/RenderBase.h" +#include "VideoBackends/OGL/Render.h" #include "VideoCommon/VideoConfig.h" namespace OGL { std::unique_ptr GetPerfQuery() { - if (g_main_gl_context->IsGLES() && GLExtensions::Supports("GL_NV_occlusion_query_samples")) + const bool is_gles = static_cast(g_renderer.get())->IsGLES(); + if (is_gles && GLExtensions::Supports("GL_NV_occlusion_query_samples")) return std::make_unique(); - - if (g_main_gl_context->IsGLES()) + else if (is_gles) return std::make_unique(GL_ANY_SAMPLES_PASSED); - - return std::make_unique(GL_SAMPLES_PASSED); + else + return std::make_unique(GL_SAMPLES_PASSED); } PerfQuery::PerfQuery() : m_query_read_pos() -- cgit v1.2.3