From 38161f3c69de5830943c2307b8b7f3a84f11fbdc Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 20 Jan 2018 09:05:52 -0800 Subject: [PATCH] GLES: Use linear for high-res FBO tex copies. --- GPU/GLES/FramebufferManagerGLES.cpp | 2 +- GPU/GLES/StateMappingGLES.cpp | 3 +++ ext/native/thin3d/GLQueueRunner.cpp | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/GPU/GLES/FramebufferManagerGLES.cpp b/GPU/GLES/FramebufferManagerGLES.cpp index adf573502f..42015c1169 100644 --- a/GPU/GLES/FramebufferManagerGLES.cpp +++ b/GPU/GLES/FramebufferManagerGLES.cpp @@ -494,7 +494,7 @@ void FramebufferManagerGLES::BlitFramebufferDepth(VirtualFramebuffer *src, Virtu void FramebufferManagerGLES::BindFramebufferAsColorTexture(int stage, VirtualFramebuffer *framebuffer, int flags) { if (!framebuffer->fbo || !useBufferedRendering_) { - render_->BindTexture(0, nullptr); + render_->BindTexture(stage, nullptr); gstate_c.skipDrawReason |= SKIPDRAW_BAD_FB_TEXTURE; return; } diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 65ea0efdc0..a16f7a4e82 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -319,6 +319,9 @@ void DrawEngineGLES::ApplyDrawStateLate(bool setStencil, int stencilValue) { // Note that this is positions, not UVs, that we need the copy from. framebufferManager_->BindFramebufferAsColorTexture(1, framebufferManager_->GetCurrentRenderVFB(), BINDFBCOLOR_MAY_COPY); framebufferManager_->RebindFramebuffer(); + GLRenderManager *renderManager = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); + // If we are rendering at a higher resolution, linear is probably best for the dest color. + renderManager->SetTextureSampler(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, GL_LINEAR, GL_LINEAR, 0.0f); fboTexBound_ = true; fboTexNeedBind_ = false; } diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index 863398d745..7fc9cb5fdf 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -1056,8 +1056,8 @@ void GLQueueRunner::fbo_ext_create(const GLRInitStep &step) { fbo->color_texture.target = GL_TEXTURE_2D; fbo->color_texture.wrapS = GL_CLAMP_TO_EDGE; fbo->color_texture.wrapT = GL_CLAMP_TO_EDGE; - fbo->color_texture.magFilter = step.texture_image.linearFilter ? GL_LINEAR : GL_NEAREST; - fbo->color_texture.minFilter = step.texture_image.linearFilter ? GL_LINEAR : GL_NEAREST; + fbo->color_texture.magFilter = GL_LINEAR; + fbo->color_texture.minFilter = GL_LINEAR; fbo->color_texture.maxLod = 0.0f; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, fbo->color_texture.wrapS); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, fbo->color_texture.wrapT);