From 7ef5e5cd1e7d63d57527399b14c3a685f5002b90 Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Mon, 16 Mar 2009 05:04:59 +0000 Subject: [PATCH] Make destination alpha render pass an option. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2663 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/Config.cpp | 2 ++ Source/Plugins/Plugin_VideoOGL/Src/Config.h | 1 + Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp | 9 +++++++++ Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h | 2 ++ Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp index c2cae22822..c905996044 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp @@ -61,6 +61,7 @@ void Config::Load() iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0); iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0); iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0); + iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false); iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0); iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0); @@ -109,6 +110,7 @@ void Config::Save() iniFile.Set("Settings", "Wireframe", bWireFrame); iniFile.Set("Settings", "DisableLighting", bDisableLighting); iniFile.Set("Settings", "DisableTexturing", bDisableTexturing); + iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass); iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering); iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.h b/Source/Plugins/Plugin_VideoOGL/Src/Config.h index 880164a987..a435338c2d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.h @@ -77,6 +77,7 @@ struct Config bool bWireFrame; bool bDisableLighting; bool bDisableTexturing; + bool bDstAlphaPass; // Utility bool bDumpTextures; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 106ce6df46..8006fcda01 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -58,6 +58,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog) EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged) + EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged) EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, ConfigDialog::AdvancedSettingsChanged) EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, ConfigDialog::AdvancedSettingsChanged) @@ -300,6 +301,9 @@ void ConfigDialog::CreateGUIControls() m_DisableTexturing = new wxCheckBox(m_PageAdvanced, ID_DISABLETEXTURING, wxT("Disable Texturing"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_DisableTexturing->SetValue(g_Config.bDisableTexturing); m_DisableTexturing->Enable(true); + m_DstAlphaPass = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass); + m_DstAlphaPass->Enable(true); m_StaticBox_EFB = new wxStaticBox(m_PageAdvanced, ID_STATICBOX_EFB, wxT("EFB Copy")); m_CheckBox_DisableCopyEFB = new wxCheckBox(m_PageAdvanced, ID_CHECKBOX_DISABLECOPYEFB, wxT("Disable")); @@ -344,6 +348,7 @@ void ConfigDialog::CreateGUIControls() " [This option will apply immediately and does not require a restart. However it may not" " be entirely safe to change it midgames.]")); m_ProjectionHax1->SetToolTip(wxT("This should get ZTP's Bloom to show")); + m_DstAlphaPass->SetToolTip(wxT("This renders a second time to set alpha to a constant value")); // Sizers sHacks = new wxGridBagSizer(0, 0); @@ -370,6 +375,7 @@ void ConfigDialog::CreateGUIControls() sRendering->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_DisableLighting, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_DisableTexturing, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5); + sRendering->Add(m_DstAlphaPass, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5); sRenderBoxRow1->Add(sRendering, 0, wxALL|wxEXPAND, 5); wxStaticBoxSizer *sSBox = new wxStaticBoxSizer(m_StaticBox_EFB, wxVERTICAL); wxBoxSizer *sStrip1 = new wxBoxSizer(wxHORIZONTAL); @@ -503,6 +509,9 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event) case ID_DISABLETEXTURING: g_Config.bDisableTexturing = m_DisableTexturing->IsChecked(); break; + case ID_DSTALPHAPASS: + g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked(); + break; case ID_DUMPTEXTURES: g_Config.bDumpTextures = m_DumpTextures->IsChecked(); break; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h index 9af962d3b5..362d5c6db5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h @@ -102,6 +102,7 @@ class ConfigDialog : public wxDialog wxCheckBox *m_Wireframe; wxCheckBox *m_DisableLighting; wxCheckBox *m_DisableTexturing; + wxCheckBox *m_DstAlphaPass; wxCheckBox *m_DumpTextures; wxCheckBox *m_DumpEFBTarget; wxStaticBox * m_StaticBox_EFB; @@ -163,6 +164,7 @@ class ConfigDialog : public wxDialog ID_CHECKBOX_DISABLECOPYEFB, ID_EFBCOPYDISABLEHOTKEY, ID_PROJECTIONHACK1, + ID_DSTALPHAPASS, ID_RADIO_COPYEFBTORAM, ID_RADIO_COPYEFBTOGL, }; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index bc2179f227..93d6a95491 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -285,7 +285,7 @@ void Flush() } // run through vertex groups again to set alpha - if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate) { + if (g_Config.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate) { ps = PixelShaderCache::GetShader(true); if (ps) glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ps->glprogid);