Added option "Show EFB Copy Regions" to find out which games are heavy on EFB-Copy. Changed Dst Alpha Pass option to "Disable Dst Alpha Pass".
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2665 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
86944b5be2
commit
845204c227
|
@ -16,6 +16,8 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "CommonTypes.h"
|
||||
#include "VideoCommon.h"
|
||||
#include <vector>
|
||||
|
||||
#ifndef _STATISTICS_H
|
||||
#define _STATISTICS_H
|
||||
|
@ -55,6 +57,8 @@ struct Statistics
|
|||
float g2proj_0, g2proj_1, g2proj_2, g2proj_3, g2proj_4, g2proj_5;
|
||||
float g2proj_6, g2proj_7, g2proj_8, g2proj_9, g2proj_10, g2proj_11, g2proj_12, g2proj_13, g2proj_14, g2proj_15;
|
||||
|
||||
std::vector<TRectangle> efb_regions;
|
||||
|
||||
struct ThisFrame
|
||||
{
|
||||
int numBPLoads;
|
||||
|
|
|
@ -392,6 +392,9 @@ void BPWritten(int addr, int changes, int newval)
|
|||
// --------------------------
|
||||
if (PE_copy.copy_to_xfb == 0)
|
||||
{
|
||||
if (g_Config.bShowEFBCopyRegions)
|
||||
stats.efb_regions.push_back(rc);
|
||||
|
||||
// EFB to texture
|
||||
// for some reason it sets bpmem.zcontrol.pixel_format to PIXELFMT_Z24 every time a zbuffer format is given as a dest to GXSetTexCopyDst
|
||||
if (!g_Config.bEFBCopyDisable)
|
||||
|
|
|
@ -56,6 +56,7 @@ void Config::Load()
|
|||
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
|
||||
iniFile.Get("Settings", "OverlayBlendStats", &bOverlayBlendStats, false);
|
||||
iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false);
|
||||
iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
|
||||
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
|
||||
iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
|
||||
iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
|
||||
|
@ -101,9 +102,10 @@ void Config::Save()
|
|||
iniFile.Set("Settings", "OverlayBlendStats", bOverlayBlendStats);
|
||||
iniFile.Set("Settings", "OverlayProjStats", bOverlayProjStats);
|
||||
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
|
||||
iniFile.Set("Settings", "Show", iCompileDLsLevel);
|
||||
iniFile.Set("Settings", "DumpTextures", bDumpTextures);
|
||||
iniFile.Set("Settings", "DumpEFBTarget", bDumpEFBTarget);
|
||||
iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
|
||||
iniFile.Set("Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
|
||||
iniFile.Set("Settings", "MSAA", iMultisampleMode);
|
||||
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
||||
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
|
||||
|
|
|
@ -72,6 +72,7 @@ struct Config
|
|||
bool bOverlayProjStats;
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
bool bShowEFBCopyRegions;
|
||||
|
||||
// Render
|
||||
bool bWireFrame;
|
||||
|
|
|
@ -48,6 +48,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
|||
EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_BLENDSTATS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_PROJSTATS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWEFBCOPYREGIONS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHADERERRORS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTOVERLAY, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTCENTER, ConfigDialog::AdvancedSettingsChanged)
|
||||
|
@ -281,6 +282,8 @@ void ConfigDialog::CreateGUIControls()
|
|||
m_BlendStats->SetValue(g_Config.bOverlayBlendStats);
|
||||
m_ProjStats = new wxCheckBox(m_PageAdvanced, ID_PROJSTATS, wxT("Overlay Projection Stats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_ProjStats->SetValue(g_Config.bOverlayProjStats);
|
||||
m_ShowEFBCopyRegions = new wxCheckBox(m_PageAdvanced, ID_SHOWEFBCOPYREGIONS, wxT("Show EFB Copy Regions"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_ShowEFBCopyRegions->SetValue(g_Config.bShowEFBCopyRegions);
|
||||
m_ShaderErrors = new wxCheckBox(m_PageAdvanced, ID_SHADERERRORS, wxT("Show shader compilation issues"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
|
||||
m_ShaderErrors->Enable(false);
|
||||
|
@ -301,7 +304,7 @@ 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 = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Disable Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass);
|
||||
m_DstAlphaPass->Enable(true);
|
||||
|
||||
|
@ -366,8 +369,9 @@ void ConfigDialog::CreateGUIControls()
|
|||
sInfo->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sInfo->Add(m_BlendStats, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sInfo->Add(m_ProjStats, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sInfo->Add(m_TexFmtOverlay, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sInfo->Add(m_TexFmtCenter, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sInfo->Add(m_ShowEFBCopyRegions, wxGBPosition(5, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sInfo->Add(m_TexFmtOverlay, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sInfo->Add(m_TexFmtCenter, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbInfo->Add(sInfo);
|
||||
|
||||
wxBoxSizer *sRenderBoxRow1 = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -500,6 +504,9 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
|
|||
g_Config.bTexFmtOverlayCenter = m_TexFmtCenter->IsChecked();
|
||||
TextureMngr::Invalidate(false);
|
||||
break;
|
||||
case ID_SHOWEFBCOPYREGIONS:
|
||||
g_Config.bShowEFBCopyRegions = m_ShowEFBCopyRegions->IsChecked();
|
||||
break;
|
||||
case ID_WIREFRAME:
|
||||
g_Config.bWireFrame = m_Wireframe->IsChecked();
|
||||
break;
|
||||
|
|
|
@ -97,6 +97,7 @@ class ConfigDialog : public wxDialog
|
|||
wxCheckBox *m_Statistics;
|
||||
wxCheckBox *m_BlendStats;
|
||||
wxCheckBox *m_ProjStats;
|
||||
wxCheckBox *m_ShowEFBCopyRegions;
|
||||
wxCheckBox *m_TexFmtOverlay;
|
||||
wxCheckBox *m_TexFmtCenter;
|
||||
wxCheckBox *m_Wireframe;
|
||||
|
@ -148,6 +149,7 @@ class ConfigDialog : public wxDialog
|
|||
ID_STATISTICS,
|
||||
ID_BLENDSTATS,
|
||||
ID_PROJSTATS,
|
||||
ID_SHOWEFBCOPYREGIONS,
|
||||
ID_TEXFMTOVERLAY,
|
||||
ID_TEXFMTCENTER,
|
||||
|
||||
|
|
|
@ -1124,7 +1124,39 @@ void Renderer::DrawDebugText()
|
|||
p+=sprintf(p, "FPS: %d\n", s_fps);
|
||||
}
|
||||
|
||||
if (g_Config.bOverlayStats) {
|
||||
if (g_Config.bShowEFBCopyRegions)
|
||||
{
|
||||
glLineWidth(8.0f);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
|
||||
for (std::vector<TRectangle>::const_iterator it = stats.efb_regions.begin(); it != stats.efb_regions.end(); ++it)
|
||||
{
|
||||
GLfloat x = (GLfloat) -1.0f + (it->left / Renderer::GetTargetWidth());
|
||||
GLfloat y = (GLfloat) 1.0f + (it->top / Renderer::GetTargetHeight());
|
||||
GLfloat x2 = (GLfloat) (x + it->GetWidth()) / Renderer::GetTargetWidth();
|
||||
GLfloat y2 = (GLfloat) (y - it->GetHeight()) / Renderer::GetTargetHeight();
|
||||
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
glVertex2f(x, y - 0.01f); glVertex2f(x2 + 0.008f, y - 0.01f);
|
||||
glVertex2f(x, y2 - 0.01f); glVertex2f(x2 + 0.008f, y2 - 0.01f);
|
||||
glVertex2f(x - 0.01f, y); glVertex2f(x - 0.01f, y2 + 0.008f);
|
||||
glVertex2f(x2 - 0.01f, y); glVertex2f(x2 - 0.01f, y2 + 0.008f);
|
||||
|
||||
glColor3f(0.0f, 1.0f, 1.0f);
|
||||
glVertex2f(x, y); glVertex2f(x2 + 0.008f, y);
|
||||
glVertex2f(x, y2); glVertex2f(x2 + 0.008f, y2);
|
||||
glVertex2f(x, y); glVertex2f(x, y2 + 0.008f);
|
||||
glVertex2f(x2, y); glVertex2f(x2, y2 + 0.008f);
|
||||
}
|
||||
|
||||
glEnd();
|
||||
|
||||
stats.efb_regions.clear();
|
||||
}
|
||||
|
||||
if (g_Config.bOverlayStats)
|
||||
{
|
||||
p+=sprintf(p,"textures created: %i\n",stats.numTexturesCreated);
|
||||
p+=sprintf(p,"textures alive: %i\n",stats.numTexturesAlive);
|
||||
p+=sprintf(p,"pshaders created: %i\n",stats.numPixelShadersCreated);
|
||||
|
|
|
@ -285,7 +285,7 @@ void Flush()
|
|||
}
|
||||
|
||||
// run through vertex groups again to set alpha
|
||||
if (g_Config.bDstAlphaPass && 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);
|
||||
|
|
Loading…
Reference in New Issue