mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Various UI and documentation improvements to the GFX debugger.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7661 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -141,31 +141,28 @@ void GFXDebuggerPanel::CreateGUIControls()
|
|||||||
// Basic settings
|
// Basic settings
|
||||||
CenterOnParent();
|
CenterOnParent();
|
||||||
|
|
||||||
// MainPanel
|
m_pButtonPause = new wxButton(this, ID_PAUSE, _("Pause"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Pause"));
|
||||||
m_MainPanel = new wxPanel(this, ID_MAINPANEL, wxDefaultPosition, wxDefaultSize);
|
m_pButtonPauseAtNext = new wxButton(this, ID_PAUSE_AT_NEXT, _("Pause After"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Pause At Next"));
|
||||||
|
m_pButtonPauseAtNextFrame = new wxButton(this, ID_PAUSE_AT_NEXT_FRAME, _("Go to Next Frame"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Next Frame"));
|
||||||
|
m_pButtonCont = new wxButton(this, ID_CONT, _("Continue"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Continue"));
|
||||||
|
|
||||||
m_pButtonPause = new wxButton(m_MainPanel, ID_PAUSE, _("Pause"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Pause"));
|
m_pCount = new wxTextCtrl(this, ID_COUNT, wxT("1"), wxDefaultPosition, wxSize(50,25), wxTE_RIGHT, wxDefaultValidator, _("Count"));
|
||||||
m_pButtonPauseAtNext = new wxButton(m_MainPanel, ID_PAUSE_AT_NEXT, _("Pause At Next"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Pause At Next"));
|
|
||||||
m_pButtonPauseAtNextFrame = new wxButton(m_MainPanel, ID_PAUSE_AT_NEXT_FRAME, _("Next Frame"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Next Frame"));
|
|
||||||
m_pButtonCont = new wxButton(m_MainPanel, ID_CONT, _("Continue"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Continue"));
|
|
||||||
|
|
||||||
m_pPauseAtList = new wxChoice(m_MainPanel, ID_PAUSE_AT_LIST, wxDefaultPosition, wxSize(100,25), 0, NULL,0,wxDefaultValidator, _("PauseAtList"));
|
m_pPauseAtList = new wxChoice(this, ID_PAUSE_AT_LIST, wxDefaultPosition, wxSize(100,25), 0, NULL,0,wxDefaultValidator, _("PauseAtList"));
|
||||||
for (int i=0; i<numPauseEventMap; i++)
|
for (int i=0; i<numPauseEventMap; i++)
|
||||||
{
|
{
|
||||||
m_pPauseAtList->Append(pauseEventMap[i].ListStr);
|
m_pPauseAtList->Append(pauseEventMap[i].ListStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pPauseAtList->SetSelection(0);
|
m_pPauseAtList->SetSelection(0);
|
||||||
|
|
||||||
m_pButtonDump = new wxButton(m_MainPanel, ID_DUMP, _("Dump"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Dump"));
|
m_pButtonDump = new wxButton(this, ID_DUMP, _("Dump"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Dump"));
|
||||||
m_pButtonUpdateScreen = new wxButton(m_MainPanel, ID_UPDATE_SCREEN, _("Update Screen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Update Screen"));
|
m_pButtonUpdateScreen = new wxButton(this, ID_UPDATE_SCREEN, _("Update Screen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Update Screen"));
|
||||||
m_pButtonClearScreen = new wxButton(m_MainPanel, ID_CLEAR_SCREEN, _("Clear Screen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear Screen"));
|
m_pButtonClearScreen = new wxButton(this, ID_CLEAR_SCREEN, _("Clear Screen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear Screen"));
|
||||||
m_pButtonClearTextureCache = new wxButton(m_MainPanel, ID_CLEAR_TEXTURE_CACHE, _("Clear Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear Textures"));
|
m_pButtonClearTextureCache = new wxButton(this, ID_CLEAR_TEXTURE_CACHE, _("Clear Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear Textures"));
|
||||||
m_pButtonClearVertexShaderCache = new wxButton(m_MainPanel, ID_CLEAR_VERTEX_SHADER_CACHE, _("Clear V Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear V Shaders"));
|
m_pButtonClearVertexShaderCache = new wxButton(this, ID_CLEAR_VERTEX_SHADER_CACHE, _("Clear V Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear V Shaders"));
|
||||||
m_pButtonClearPixelShaderCache = new wxButton(m_MainPanel, ID_CLEAR_PIXEL_SHADER_CACHE, _("Clear P Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear P Shaders"));
|
m_pButtonClearPixelShaderCache = new wxButton(this, ID_CLEAR_PIXEL_SHADER_CACHE, _("Clear P Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Clear P Shaders"));
|
||||||
m_pCount = new wxTextCtrl(m_MainPanel, ID_COUNT, wxT("1"), wxDefaultPosition, wxSize(50,25), 0, wxDefaultValidator, _("Count"));
|
|
||||||
|
|
||||||
m_pDumpList = new wxChoice(m_MainPanel, ID_DUMP_LIST, wxDefaultPosition, wxSize(120,25), 0, NULL,0,wxDefaultValidator, _("DumpList"));
|
m_pDumpList = new wxChoice(this, ID_DUMP_LIST, wxDefaultPosition, wxSize(120,25), 0, NULL, 0 ,wxDefaultValidator, _("DumpList"));
|
||||||
m_pDumpList->Insert(_("Pixel Shader"),0);
|
m_pDumpList->Insert(_("Pixel Shader"),0);
|
||||||
m_pDumpList->Append(_("Vertex Shader"));
|
m_pDumpList->Append(_("Vertex Shader"));
|
||||||
m_pDumpList->Append(_("Pixel Shader Constants"));
|
m_pDumpList->Append(_("Pixel Shader Constants"));
|
||||||
@ -181,21 +178,32 @@ void GFXDebuggerPanel::CreateGUIControls()
|
|||||||
// Layout everything on m_MainPanel
|
// Layout everything on m_MainPanel
|
||||||
wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
sMain->Add(m_pButtonPause, 0, 0, 5);
|
wxStaticBoxSizer* const pFlowCtrlBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Flow Control"));
|
||||||
sMain->Add(m_pButtonPauseAtNext, 0, 0, 5);
|
wxBoxSizer* const pPauseAtNextSzr = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sMain->Add(m_pCount,0,0,5);
|
pFlowCtrlBox->Add(m_pButtonPause);
|
||||||
sMain->Add(m_pPauseAtList, 0, 0, 5);
|
pPauseAtNextSzr->Add(m_pButtonPauseAtNext);
|
||||||
sMain->Add(m_pButtonDump, 0, 0, 5);
|
pPauseAtNextSzr->Add(m_pCount);
|
||||||
sMain->Add(m_pDumpList, 0, 0, 5);
|
pPauseAtNextSzr->Add(m_pPauseAtList);
|
||||||
sMain->Add(m_pButtonUpdateScreen, 0, 0, 5);
|
pFlowCtrlBox->Add(pPauseAtNextSzr);
|
||||||
sMain->Add(m_pButtonClearScreen, 0, 0, 5);
|
pFlowCtrlBox->Add(m_pButtonPauseAtNextFrame);
|
||||||
sMain->Add(m_pButtonClearTextureCache, 0, 0, 5);
|
pFlowCtrlBox->Add(m_pButtonCont);
|
||||||
sMain->Add(m_pButtonClearVertexShaderCache, 0, 0, 5);
|
|
||||||
sMain->Add(m_pButtonClearPixelShaderCache, 0, 0, 5);
|
wxStaticBoxSizer* const pDebugBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Debugging"));
|
||||||
sMain->Add(m_pButtonPauseAtNextFrame, 0, 0, 5);
|
wxBoxSizer* const pDumpSzr = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sMain->Add(m_pButtonCont, 0, 0, 5);
|
pDumpSzr->Add(m_pButtonDump);
|
||||||
m_MainPanel->SetSizerAndFit(sMain);
|
pDumpSzr->Add(m_pDumpList);
|
||||||
Fit();
|
pDebugBox->Add(pDumpSzr);
|
||||||
|
wxGridSizer* const pDbgGrid = new wxGridSizer(2, 5, 5);
|
||||||
|
pDbgGrid->Add(m_pButtonUpdateScreen);
|
||||||
|
pDbgGrid->Add(m_pButtonClearScreen);
|
||||||
|
pDbgGrid->Add(m_pButtonClearTextureCache);
|
||||||
|
pDbgGrid->Add(m_pButtonClearVertexShaderCache);
|
||||||
|
pDbgGrid->Add(m_pButtonClearPixelShaderCache);
|
||||||
|
pDebugBox->Add(pDbgGrid);
|
||||||
|
|
||||||
|
sMain->Add(pFlowCtrlBox, 0, 0, 5);
|
||||||
|
sMain->Add(pDebugBox, 0, 0, 5);
|
||||||
|
SetSizerAndFit(sMain);
|
||||||
|
|
||||||
OnContinue();
|
OnContinue();
|
||||||
}
|
}
|
||||||
@ -203,6 +211,7 @@ void GFXDebuggerPanel::CreateGUIControls()
|
|||||||
void GFXDebuggerPanel::OnPause()
|
void GFXDebuggerPanel::OnPause()
|
||||||
{
|
{
|
||||||
m_pButtonDump->Enable(true);
|
m_pButtonDump->Enable(true);
|
||||||
|
m_pDumpList->Enable(true);
|
||||||
m_pButtonUpdateScreen->Enable(true);
|
m_pButtonUpdateScreen->Enable(true);
|
||||||
m_pButtonClearScreen->Enable(true);
|
m_pButtonClearScreen->Enable(true);
|
||||||
m_pButtonClearTextureCache->Enable(true);
|
m_pButtonClearTextureCache->Enable(true);
|
||||||
@ -213,6 +222,7 @@ void GFXDebuggerPanel::OnPause()
|
|||||||
void GFXDebuggerPanel::OnContinue()
|
void GFXDebuggerPanel::OnContinue()
|
||||||
{
|
{
|
||||||
m_pButtonDump->Enable(false);
|
m_pButtonDump->Enable(false);
|
||||||
|
m_pDumpList->Enable(false);
|
||||||
m_pButtonUpdateScreen->Enable(false);
|
m_pButtonUpdateScreen->Enable(false);
|
||||||
m_pButtonClearScreen->Enable(false);
|
m_pButtonClearScreen->Enable(false);
|
||||||
m_pButtonClearTextureCache->Enable(false);
|
m_pButtonClearTextureCache->Enable(false);
|
||||||
@ -341,5 +351,6 @@ void GFXDebuggerPanel::OnClearPixelShaderCacheButton(wxCommandEvent& event)
|
|||||||
|
|
||||||
void GFXDebuggerPanel::OnUpdateScreenButton(wxCommandEvent& event)
|
void GFXDebuggerPanel::OnUpdateScreenButton(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
|
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
|
||||||
GFXDebuggerUpdateScreen();
|
GFXDebuggerUpdateScreen();
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,8 @@ public:
|
|||||||
bool bSaveShaders;
|
bool bSaveShaders;
|
||||||
|
|
||||||
void OnPause();
|
void OnPause();
|
||||||
|
|
||||||
|
// Called from GFX thread once the GFXDebuggerPauseFlag spin lock has finished
|
||||||
void OnContinue();
|
void OnContinue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -89,11 +91,17 @@ private:
|
|||||||
void CreateGUIControls();
|
void CreateGUIControls();
|
||||||
|
|
||||||
void GeneralSettings(wxCommandEvent& event);
|
void GeneralSettings(wxCommandEvent& event);
|
||||||
|
|
||||||
|
// These set GFXDebuggerPauseFlag to true (either immediately or once the specified event has occured)
|
||||||
void OnPauseButton(wxCommandEvent& event);
|
void OnPauseButton(wxCommandEvent& event);
|
||||||
void OnPauseAtNextButton(wxCommandEvent& event);
|
void OnPauseAtNextButton(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnPauseAtNextFrameButton(wxCommandEvent& event);
|
void OnPauseAtNextFrameButton(wxCommandEvent& event);
|
||||||
void OnDumpButton(wxCommandEvent& event);
|
void OnDumpButton(wxCommandEvent& event);
|
||||||
|
|
||||||
|
// sets GFXDebuggerPauseFlag to false
|
||||||
void OnContButton(wxCommandEvent& event);
|
void OnContButton(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnUpdateScreenButton(wxCommandEvent& event);
|
void OnUpdateScreenButton(wxCommandEvent& event);
|
||||||
void OnClearScreenButton(wxCommandEvent& event);
|
void OnClearScreenButton(wxCommandEvent& event);
|
||||||
void OnClearTextureCacheButton(wxCommandEvent& event);
|
void OnClearTextureCacheButton(wxCommandEvent& event);
|
||||||
|
@ -30,9 +30,9 @@
|
|||||||
extern NativeVertexFormat *g_nativeVertexFmt;
|
extern NativeVertexFormat *g_nativeVertexFmt;
|
||||||
|
|
||||||
GFXDebuggerBase *g_pdebugger = NULL;
|
GFXDebuggerBase *g_pdebugger = NULL;
|
||||||
volatile bool GFXDebuggerPauseFlag = false;
|
volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again
|
||||||
volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE;
|
volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE; // Event which will trigger spin locking the GFX thread
|
||||||
volatile int GFXDebuggerEventToPauseCount = 0;
|
volatile int GFXDebuggerEventToPauseCount = 0; // Number of events to wait for until GFX thread will be paused
|
||||||
|
|
||||||
void GFXDebuggerUpdateScreen()
|
void GFXDebuggerUpdateScreen()
|
||||||
{
|
{
|
||||||
@ -62,6 +62,7 @@ void GFXDebuggerUpdateScreen()
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GFX thread
|
||||||
void GFXDebuggerCheckAndPause(bool update)
|
void GFXDebuggerCheckAndPause(bool update)
|
||||||
{
|
{
|
||||||
if (GFXDebuggerPauseFlag)
|
if (GFXDebuggerPauseFlag)
|
||||||
@ -78,6 +79,7 @@ void GFXDebuggerCheckAndPause(bool update)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GFX thread
|
||||||
void GFXDebuggerToPause(bool update)
|
void GFXDebuggerToPause(bool update)
|
||||||
{
|
{
|
||||||
GFXDebuggerToPauseAtNext = NOT_PAUSE;
|
GFXDebuggerToPauseAtNext = NOT_PAUSE;
|
||||||
@ -97,7 +99,7 @@ void GFXDebuggerBase::DumpPixelShader(const char* path)
|
|||||||
sprintf(filename, "%sdump_ps.txt", path);
|
sprintf(filename, "%sdump_ps.txt", path);
|
||||||
|
|
||||||
std::string output;
|
std::string output;
|
||||||
bool useDstAlpha = bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
||||||
if (!useDstAlpha)
|
if (!useDstAlpha)
|
||||||
{
|
{
|
||||||
output = "Destination alpha disabled:\n";
|
output = "Destination alpha disabled:\n";
|
||||||
|
Reference in New Issue
Block a user