From ced2dd9200ce18e65199f1dbd97eafdb188b2b74 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 11 Jan 2017 18:43:45 +0100 Subject: [PATCH] gsdx: hidden option disable_hw_gl_draw OMG, Zone of Ender got a speed boost from 11 fps to 45 fps Seriously, the goal is to allow benchmarking GSdx without too much overhead of the main renderer draw call Note: unlike the null renderer, texture/vertex uploading, 2D draw, texture conversions are still done. --- plugins/GSdx/GSDeviceOGL.cpp | 8 ++++++-- plugins/GSdx/GSDeviceOGL.h | 2 ++ plugins/GSdx/GSdx.cpp | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 38f8d9d552..190b5fbd58 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -88,6 +88,8 @@ GSDeviceOGL::GSDeviceOGL() #endif m_debug_gl_call = theApp.GetConfigB("debug_opengl"); + + m_disable_hw_gl_draw = theApp.GetConfigB("disable_hw_gl_draw"); } GSDeviceOGL::~GSDeviceOGL() @@ -653,7 +655,8 @@ void GSDeviceOGL::DrawPrimitive(int offset, int count) void GSDeviceOGL::DrawIndexedPrimitive() { BeforeDraw(); - m_va->DrawIndexedPrimitive(); + if (!m_disable_hw_gl_draw) + m_va->DrawIndexedPrimitive(); AfterDraw(); } @@ -662,7 +665,8 @@ void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count) //ASSERT(offset + count <= (int)m_index.count); BeforeDraw(); - m_va->DrawIndexedPrimitive(offset, count); + if (!m_disable_hw_gl_draw) + m_va->DrawIndexedPrimitive(offset, count); AfterDraw(); } diff --git a/plugins/GSdx/GSDeviceOGL.h b/plugins/GSdx/GSDeviceOGL.h index 53960b8aa0..59899e3076 100644 --- a/plugins/GSdx/GSDeviceOGL.h +++ b/plugins/GSdx/GSDeviceOGL.h @@ -416,6 +416,8 @@ public: static bool m_debug_gl_call; static FILE* m_debug_gl_file; + bool m_disable_hw_gl_draw; + GSWnd* m_window; GLuint m_fbo; // frame buffer container diff --git a/plugins/GSdx/GSdx.cpp b/plugins/GSdx/GSdx.cpp index 67a549a07d..a6e25433b0 100644 --- a/plugins/GSdx/GSdx.cpp +++ b/plugins/GSdx/GSdx.cpp @@ -296,6 +296,7 @@ void GSdxApp::Init() m_default_configuration["CrcHacksExclusions"] = ""; m_default_configuration["debug_glsl_shader"] = "0"; m_default_configuration["debug_opengl"] = "0"; + m_default_configuration["disable_hw_gl_draw"] = "0"; m_default_configuration["dump"] = "0"; m_default_configuration["extrathreads"] = "2"; m_default_configuration["extrathreads_height"] = "4";