From 2ed8aab2d7ac8154ad9d4f4da8859f45799e4375 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 15 Nov 2015 15:06:09 -0800 Subject: [PATCH] Avoid direct refs to OES_texture_npot. So that we can control it centrally in GLES_GPU. --- GPU/GLES/Framebuffer.cpp | 3 ++- GPU/GLES/TextureCache.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index d18ca3935d..37c2b9a466 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1302,7 +1302,8 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s #ifdef USING_GLES2 PackFramebufferSync_(nvfb, x, y, w, h); #else - if (gl_extensions.ARB_pixel_buffer_object && gl_extensions.OES_texture_npot) { + // TODO: Can we fall back to sync without these? + if (gl_extensions.ARB_pixel_buffer_object && gstate_c.Supports(GPU_SUPPORTS_OES_TEXTURE_NPOT)) { if (!sync) { PackFramebufferAsync_(nvfb); } else { diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index e848ba9061..d8c6555c0c 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1498,8 +1498,9 @@ void TextureCache::SetTexture(bool force) { // Mobile devices don't get the higher scale factors, too expensive. Very rough way to decide though... if (!gstate_c.Supports(GPU_IS_MOBILE)) { - scaleFactor = std::min(gstate_c.Supports(GPU_SUPPORTS_OES_TEXTURE_NPOT) ? 5 : 4, scaleFactor); - if (!gl_extensions.OES_texture_npot && scaleFactor == 3) { + bool supportNpot = gstate_c.Supports(GPU_SUPPORTS_OES_TEXTURE_NPOT); + scaleFactor = std::min(supportNpot ? 5 : 4, scaleFactor); + if (!supportNpot && scaleFactor == 3) { scaleFactor = 2; } } else {