From 1aa3c39f774efe285abb903145e7a8533c31ee50 Mon Sep 17 00:00:00 2001 From: danyalzia Date: Sun, 29 Sep 2013 00:17:19 +0500 Subject: [PATCH 1/2] Do not read through PBOs --- GPU/GLES/Framebuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index c2af11f282..70909c4159 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -867,11 +867,14 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s #ifdef USING_GLES2 PackFramebufferSync_(nvfb); // synchronous glReadPixels #else + if(gl_extensions.PBO_ARB || !gl_extensions.ATIClampBug) + { if(!sync) { PackFramebufferAsync_(nvfb); // asynchronous glReadPixels using PBOs } else { PackFramebufferSync_(nvfb); // synchronous glReadPixels } + } #endif } } From 12d15bc13e78ec72d52a4085b348aacacaf8882d Mon Sep 17 00:00:00 2001 From: danyalzia Date: Sun, 29 Sep 2013 00:25:13 +0500 Subject: [PATCH 2/2] fix a clamping bug in pre-HD ATI/AMD drivers --- GPU/GLES/TextureCache.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index b54fd23799..f84e72b869 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -30,6 +30,7 @@ #include "ext/xxhash.h" #include "math/math_util.h" #include "native/ext/cityhash/city.h" +#include "native/gfx_es2/gl_state.h" #ifdef _M_SSE #include @@ -510,13 +511,22 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, MagFiltGL[magFilt]); entry.magFilt = magFilt; } - if (force || entry.sClamp != sClamp) { + + //Workaround to fix a clamping bug in pre-HD ATI/AMD drivers + if (gl_extensions.ATIClampBug && entry.framebuffer) + { + return; + } + else + { + if (force || entry.sClamp != sClamp) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, sClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT); entry.sClamp = sClamp; - } - if (force || entry.tClamp != tClamp) { + } + if (force || entry.tClamp != tClamp) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, tClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT); entry.tClamp = tClamp; + } } }