summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/Render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/Render.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp
index fc28a3118f..d5f2bac843 100644
--- a/Source/Core/VideoBackends/OGL/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Render.cpp
@@ -52,7 +52,7 @@ void VideoConfig::UpdateProjectionHack()
}
static int OSDInternalW, OSDInternalH;
-static int s_max_texture_size;
+static int s_max_texture_size = 0;
namespace OGL
{
@@ -711,9 +711,6 @@ void Renderer::Init()
s_raster_font = std::make_unique<RasterFont>();
OpenGL_CreateAttributelessVAO();
-
- // Cache this, because if you do this multiple times a frame, it shows up really high on a profile.
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &s_max_texture_size);
}
void Renderer::RenderText(const std::string& text, int left, int top, u32 color)
@@ -1702,6 +1699,10 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
int Renderer::GetMaxTextureSize()
{
+ // Right now nvidia seems to do something very weird if we try to cache GL_MAX_TEXTURE_SIZE in init. This is a workaround that lets
+ // us keep the perf improvement that caching it gives us.
+ if (s_max_texture_size == 0)
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &s_max_texture_size);
return s_max_texture_size;
}