From 1522cba5b07077b59b915556f93d65e367daa3f2 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 16 May 2016 10:38:47 +0200 Subject: [PATCH] gsdx ogl: performance note of texture clear vs framebuffer clear In case of render target. FB clear is better --- plugins/GSdx/GSDeviceOGL.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index ec06af1162..668863f3fb 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -526,6 +526,10 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c) if (T->HasBeenCleaned() && !T->IsBackbuffer()) return; + // Performance note: potentially T->Clear() could be used. However the render target + // will be used right away as the render target. So in all case, FBO must be binded + // and the texture attached too. So using the old/standard path is better. + GL_PUSH("Clear RT %d", T->GetID()); // TODO: check size of scissor before toggling it