From ac119158924642a023f1a814aa8e87a0a1cc9139 Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Sun, 8 Mar 2009 23:46:47 +0000 Subject: [PATCH] Added "Overlay Projection Stats" to D3D git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2626 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/Config.cpp | 3 +- Source/Plugins/Plugin_VideoDX9/Src/Config.h | 1 + .../Plugin_VideoDX9/Src/DlgSettings.cpp | 2 ++ Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 29 ++++++++++++++++++- Source/Plugins/Plugin_VideoDX9/Src/resource.h | 1 + .../Plugins/Plugin_VideoDX9/Src/resource.rc | 5 ++-- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp index 5d2629a2c3..104624537f 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp @@ -38,6 +38,7 @@ void Config::Load() iAdapter = 0; iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false); + iniFile.Get("Settings", "OverlayProjection", &bOverlayProjStats, false); iniFile.Get("Settings", "Postprocess", &iPostprocessEffect, 0); iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0); iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0); @@ -64,7 +65,7 @@ void Config::Save() iniFile.Set("Hardware", "RenderInMainframe", renderToMainframe); iniFile.Set("Settings", "OverlayStats", bOverlayStats); - iniFile.Set("Settings", "OverlayStats", bOverlayStats); + iniFile.Set("Settings", "OverlayProjection", bOverlayProjStats); iniFile.Set("Settings", "Postprocess", iPostprocessEffect); iniFile.Set("Settings", "DumpTextures", bDumpTextures); iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Config.h b/Source/Plugins/Plugin_VideoDX9/Src/Config.h index 6f86b3f346..af3944e9d8 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Config.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Config.h @@ -37,6 +37,7 @@ struct Config bool bVsync; bool bWireFrame; bool bOverlayStats; + bool bOverlayProjStats; bool bDumpTextures; bool bOldCard; bool bShowShaderErrors; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp index 092fd371ad..b53376d916 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp @@ -120,6 +120,7 @@ struct TabAdvanced : public W32Util::Tab // ComboBox_SetCurSel(opt,g_Config.iCompileDLsLevel); Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS), g_Config.bOverlayStats); + Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS), g_Config.bOverlayProjStats); Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame); Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures); Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors); @@ -156,6 +157,7 @@ struct TabAdvanced : public W32Util::Tab g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false; g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false; + g_Config.bOverlayProjStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS)) ? true : false; g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false; g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false; g_Config.bShowShaderErrors = Button_GetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS)) ? true : false; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 7866e350f3..cef384fcb2 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -239,6 +239,33 @@ void Renderer::SwapBuffers() //end frame } + if (g_Config.bOverlayProjStats) + { + char st[2048]; + char *p = st; + + p+=sprintf(p,"Projection #: X for Raw 6=0 (X for Raw 6!=0)\n\n"); + p+=sprintf(p,"Projection 0: %f (%f) Raw 0: %f\n", stats.gproj_0, stats.g2proj_0, stats.proj_0); + p+=sprintf(p,"Projection 1: %f (%f)\n", stats.gproj_1, stats.g2proj_1); + p+=sprintf(p,"Projection 2: %f (%f) Raw 1: %f\n", stats.gproj_2, stats.g2proj_2, stats.proj_1); + p+=sprintf(p,"Projection 3: %f (%f)\n\n", stats.gproj_3, stats.g2proj_3); + p+=sprintf(p,"Projection 4: %f (%f)\n", stats.gproj_4, stats.g2proj_4); + p+=sprintf(p,"Projection 5: %f (%f) Raw 2: %f\n", stats.gproj_5, stats.g2proj_5, stats.proj_2); + p+=sprintf(p,"Projection 6: %f (%f) Raw 3: %f\n", stats.gproj_6, stats.g2proj_6, stats.proj_3); + p+=sprintf(p,"Projection 7: %f (%f)\n\n", stats.gproj_7, stats.g2proj_7); + p+=sprintf(p,"Projection 8: %f (%f)\n", stats.gproj_8, stats.g2proj_8); + p+=sprintf(p,"Projection 9: %f (%f)\n", stats.gproj_9, stats.g2proj_9); + p+=sprintf(p,"Projection 10: %f (%f) Raw 4: %f\n\n", stats.gproj_10, stats.g2proj_10, stats.proj_4); + p+=sprintf(p,"Projection 11: %f (%f) Raw 5: %f\n\n", stats.gproj_11, stats.g2proj_11, stats.proj_5); + p+=sprintf(p,"Projection 12: %f (%f)\n", stats.gproj_12, stats.g2proj_12); + p+=sprintf(p,"Projection 13: %f (%f)\n", stats.gproj_13, stats.g2proj_13); + p+=sprintf(p,"Projection 14: %f (%f)\n", stats.gproj_14, stats.g2proj_14); + p+=sprintf(p,"Projection 15: %f (%f)\n", stats.gproj_15, stats.g2proj_15); + + D3D::font.DrawTextScaled(0,30,20,20,0.0f,0xFF00FFFF,st,false); + } + + ProcessMessages(); #if defined(DVPROFILE) @@ -274,7 +301,7 @@ void Renderer::SwapBuffers() vp.Width = (DWORD)m_width; vp.Height = (DWORD)m_height; vp.MinZ = 0; - vp.MaxZ = 0; + vp.MaxZ = 1.0f; D3D::dev->SetViewport(&vp); RECT rc; rc.left = 0; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/resource.h b/Source/Plugins/Plugin_VideoDX9/Src/resource.h index eb62cb1842..a1ce32f583 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/resource.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/resource.h @@ -56,6 +56,7 @@ #define IDC_CHECK3 1034 #define IDC_TEXFMT_CENTER 1034 #define IDC_TEXFMT_OVERLAY 1035 +#define IDC_OVERLAYPROJSTATS 1036 // Next default values for new objects // diff --git a/Source/Plugins/Plugin_VideoDX9/Src/resource.rc b/Source/Plugins/Plugin_VideoDX9/Src/resource.rc index 006681c729..ac2ed1cd38 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/resource.rc +++ b/Source/Plugins/Plugin_VideoDX9/Src/resource.rc @@ -57,10 +57,9 @@ BEGIN GROUPBOX "&Settings",IDC_STATIC,7,7,192,81 CONTROL "&Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,79,9 CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,31,88,9 + CONTROL "Overlay &Projection Statistics",IDC_OVERLAYPROJSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,42,118,9 CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,127,9 - LTEXT "Default display &list optimization level:",IDC_STATIC,14,57,137,9,WS_DISABLED - COMBOBOX IDC_DLOPTLEVEL,14,67,178,63,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,53,127,9 GROUPBOX "&Data dumping",IDC_STATIC,7,91,192,44 CONTROL "Dump &textures to:",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,104,70,9 EDITTEXT IDC_TEXDUMPPATH,25,116,148,12,ES_AUTOHSCROLL