diff options
| author | Anthony Serna <aserna3@gmail.com> | 2016-05-29 23:48:21 -0500 |
|---|---|---|
| committer | Anthony Serna <aserna3@gmail.com> | 2016-05-30 10:06:19 -0500 |
| commit | 0e5852f6345ab5ce9af81d5c87c6ec6b006b4903 (patch) | |
| tree | 007baf4611d5b4cd7a2916a87bcafc285525bdb3 /Source/Core/VideoBackends/OGL/Render.cpp | |
| parent | ad0ef70314e243c73e2b73dacc4204a2cbb349c9 (diff) | |
[OGL] Workaround nvidia being weird with GL_MAX_TEXTURE_SIZE
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Render.cpp | 9 |
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; } |
