From 7aad45658ee30ad6b90f7d368e413afb519bfcc4 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 16 Dec 2011 23:18:24 -0600 Subject: [PATCH] Add a GUI option to use GLSL shaders. Also fix a small typo. --- Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 12 ++++++++++++ .../Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index 20bd4dfb38..2372521be4 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -115,6 +115,7 @@ wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n #endif wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nHold the right mouse button and move the mouse to pan the camera around. Hold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked."); wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked."); +wxString GLSL_desc = wxTRANSLATE("Uses GLSL shaders in place of Nvidia CG Shaders\n\nIf unsure, leave this unchecked."); wxString opencl_desc = wxTRANSLATE("[EXPERIMENTAL]\nAims to speed up emulation by offloading texture decoding to the GPU using the OpenCL framework.\nHowever, right now it's known to cause texture defects in various games. Also it's slower than regular CPU texture decoding in most cases.\n\nIf unsure, leave this unchecked."); wxString dlc_desc = wxTRANSLATE("[EXPERIMENTAL]\nSpeeds up emulation a bit by caching display lists.\nPossibly causes issues though.\n\nIf unsure, leave this unchecked."); wxString omp_desc = wxTRANSLATE("Use multiple threads to decode textures.\nMight result in a speedup (especially on CPUs with more than two cores).\n\nIf unsure, leave this unchecked."); @@ -570,6 +571,17 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con szr_misc->Add(cb_prog_scan); } + // GLSL Option + { + if(strstr(choice_backend->GetString(choice_backend->GetSelection()).ToAscii(), "OpenGL") != NULL) + { + wxCheckBox* const cb_GLSL = CreateCheckBox(page_advanced, _("Use GLSL Shaders"), wxGetTranslation(GLSL_desc), vconfig.bUseGLSL); + szr_misc->Add(cb_GLSL); + if (Core::GetState() != Core::CORE_UNINITIALIZED) + cb_GLSL->Disable(); + } + } + wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc")); szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index 5d00ce2529..98efbb000b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -101,7 +101,7 @@ namespace OGL // points statically set in the shader source // We should only need these two functions when we don't support binding but do support UBO // Driver Bug? Nvidia GTX 570, 290.xx Driver, Linux x64 - if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO) + if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) { glUniformBlockBinding( entry.program.glprogid, 0, 1 ); glUniformBlockBinding( entry.program.glprogid, 1, 2 );