From 34692ab826abc8f8faa61bdb2280b742424528f1 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 7 Dec 2013 15:14:29 -0500 Subject: Remove unnecessary Src/ folders --- Source/Core/VideoCommon/Debugger.cpp | 161 +++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 Source/Core/VideoCommon/Debugger.cpp (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp new file mode 100644 index 0000000000..321fed8291 --- /dev/null +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -0,0 +1,161 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "IniFile.h" +#include "Debugger.h" +#include "FileUtil.h" + +#include "VideoConfig.h" +#include "TextureCacheBase.h" +#include "PixelShaderGen.h" +#include "VertexShaderGen.h" +#include "NativeVertexFormat.h" + +//void UpdateFPSDisplay(const char *text); +extern NativeVertexFormat *g_nativeVertexFmt; + +GFXDebuggerBase *g_pdebugger = NULL; +volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again +volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE; // Event which will trigger spin locking the GFX thread +volatile int GFXDebuggerEventToPauseCount = 0; // Number of events to wait for until GFX thread will be paused + +void GFXDebuggerUpdateScreen() +{ + // TODO: Implement this in a backend-independent way +/* // update screen + if (D3D::bFrameInProgress) + { + D3D::dev->SetRenderTarget(0, D3D::GetBackBufferSurface()); + D3D::dev->SetDepthStencilSurface(NULL); + + D3D::dev->StretchRect(FramebufferManager::GetEFBColorRTSurface(), NULL, + D3D::GetBackBufferSurface(), NULL, + D3DTEXF_LINEAR); + + D3D::dev->EndScene(); + D3D::dev->Present(NULL, NULL, NULL, NULL); + + D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface()); + D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface()); + D3D::dev->BeginScene(); + } + else + { + D3D::dev->EndScene(); + D3D::dev->Present(NULL, NULL, NULL, NULL); + D3D::dev->BeginScene(); + }*/ +} + +// GFX thread +void GFXDebuggerCheckAndPause(bool update) +{ + if (GFXDebuggerPauseFlag) + { + g_pdebugger->OnPause(); + while( GFXDebuggerPauseFlag ) + { + g_video_backend->UpdateFPSDisplay("Paused by Video Debugger"); + + if (update) GFXDebuggerUpdateScreen(); + SLEEP(5); + } + g_pdebugger->OnContinue(); + } +} + +// GFX thread +void GFXDebuggerToPause(bool update) +{ + GFXDebuggerToPauseAtNext = NOT_PAUSE; + GFXDebuggerPauseFlag = true; + GFXDebuggerCheckAndPause(update); +} + +void ContinueGFXDebugger() +{ + GFXDebuggerPauseFlag = false; +} + + +void GFXDebuggerBase::DumpPixelShader(const char* path) +{ + char filename[MAX_PATH]; + sprintf(filename, "%sdump_ps.txt", path); + + std::string output; + bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; + if (!useDstAlpha) + { + output = "Destination alpha disabled:\n"; +/// output += GeneratePixelShaderCode(DSTALPHA_NONE, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components); + } + else + { + if(g_ActiveConfig.backend_info.bSupportsDualSourceBlend) + { + output = "Using dual source blending for destination alpha:\n"; +/// output += GeneratePixelShaderCode(DSTALPHA_DUAL_SOURCE_BLEND, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components); + } + else + { + output = "Using two passes for emulating destination alpha:\n"; +/// output += GeneratePixelShaderCode(DSTALPHA_NONE, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components); + output += "\n\nDestination alpha pass shader:\n"; +/// output += GeneratePixelShaderCode(DSTALPHA_ALPHA_PASS, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components); + } + } + + File::CreateEmptyFile(filename); + File::WriteStringToFile(output, filename); +} + +void GFXDebuggerBase::DumpVertexShader(const char* path) +{ + char filename[MAX_PATH]; + sprintf(filename, "%sdump_vs.txt", path); + + File::CreateEmptyFile(filename); +/// File::WriteStringToFile(GenerateVertexShaderCode(g_nativeVertexFmt->m_components, g_ActiveConfig.backend_info.APIType), filename); +} + +void GFXDebuggerBase::DumpPixelShaderConstants(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpVertexShaderConstants(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpTextures(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpFrameBuffer(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpGeometry(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpVertexDecl(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpMatrices(const char* path) +{ + // TODO +} + +void GFXDebuggerBase::DumpStats(const char* path) +{ + // TODO +} -- cgit v1.2.3 From 3fd87a7636ff434118a5d7f7334550be8db55c0b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Feb 2014 23:51:41 -0500 Subject: Second and final pass of clearing out tabs. --- Source/Core/VideoCommon/Debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 321fed8291..e936060688 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -58,7 +58,7 @@ void GFXDebuggerCheckAndPause(bool update) { g_video_backend->UpdateFPSDisplay("Paused by Video Debugger"); - if (update) GFXDebuggerUpdateScreen(); + if (update) GFXDebuggerUpdateScreen(); SLEEP(5); } g_pdebugger->OnContinue(); -- cgit v1.2.3 From 2afe2152712981e21d6bda6f029292ed2b1cf91e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Feb 2014 05:18:15 -0500 Subject: Convert all includes to relative paths. --- Source/Core/VideoCommon/Debugger.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index e936060688..3a22fa8c74 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -2,15 +2,15 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "IniFile.h" -#include "Debugger.h" -#include "FileUtil.h" - -#include "VideoConfig.h" -#include "TextureCacheBase.h" -#include "PixelShaderGen.h" -#include "VertexShaderGen.h" -#include "NativeVertexFormat.h" +#include "Common/FileUtil.h" +#include "Common/IniFile.h" + +#include "VideoCommon/Debugger.h" +#include "VideoCommon/NativeVertexFormat.h" +#include "VideoCommon/TextureCacheBase.h" +#include "VideoCommon/PixelShaderGen.h" +#include "VideoCommon/VertexShaderGen.h" +#include "VideoCommon/VideoConfig.h" //void UpdateFPSDisplay(const char *text); extern NativeVertexFormat *g_nativeVertexFmt; -- cgit v1.2.3 From ffe588cc240745f0a30595c604083d37e791c670 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Wed, 19 Feb 2014 02:27:20 +0100 Subject: Fix more header sorting issues in VideoCommon/ (now check-includes clean). --- Source/Core/VideoCommon/Debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 3a22fa8c74..affeb9183a 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -7,8 +7,8 @@ #include "VideoCommon/Debugger.h" #include "VideoCommon/NativeVertexFormat.h" -#include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/PixelShaderGen.h" +#include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/VertexShaderGen.h" #include "VideoCommon/VideoConfig.h" -- cgit v1.2.3 From d802d392811be44d34ae9cd23f616db93e54c50f Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 9 Mar 2014 21:14:26 +0100 Subject: clang-modernize -use-nullptr and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine --- Source/Core/VideoCommon/Debugger.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index affeb9183a..bd711439a9 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -15,7 +15,7 @@ //void UpdateFPSDisplay(const char *text); extern NativeVertexFormat *g_nativeVertexFmt; -GFXDebuggerBase *g_pdebugger = NULL; +GFXDebuggerBase *g_pdebugger = nullptr; volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE; // Event which will trigger spin locking the GFX thread volatile int GFXDebuggerEventToPauseCount = 0; // Number of events to wait for until GFX thread will be paused @@ -27,14 +27,14 @@ void GFXDebuggerUpdateScreen() if (D3D::bFrameInProgress) { D3D::dev->SetRenderTarget(0, D3D::GetBackBufferSurface()); - D3D::dev->SetDepthStencilSurface(NULL); + D3D::dev->SetDepthStencilSurface(nullptr); - D3D::dev->StretchRect(FramebufferManager::GetEFBColorRTSurface(), NULL, - D3D::GetBackBufferSurface(), NULL, + D3D::dev->StretchRect(FramebufferManager::GetEFBColorRTSurface(), nullptr, + D3D::GetBackBufferSurface(), nullptr, D3DTEXF_LINEAR); D3D::dev->EndScene(); - D3D::dev->Present(NULL, NULL, NULL, NULL); + D3D::dev->Present(nullptr, nullptr, nullptr, nullptr); D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface()); D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface()); @@ -43,7 +43,7 @@ void GFXDebuggerUpdateScreen() else { D3D::dev->EndScene(); - D3D::dev->Present(NULL, NULL, NULL, NULL); + D3D::dev->Present(nullptr, nullptr, nullptr, nullptr); D3D::dev->BeginScene(); }*/ } -- cgit v1.2.3 From 31cfc73a09a8685cbab20502b4bc132e98e2feb5 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 11 Mar 2014 00:30:55 +1300 Subject: Fixes spacing for "for", "while", "switch" and "if" Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining. --- Source/Core/VideoCommon/Debugger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index bd711439a9..98db44bd05 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -54,7 +54,7 @@ void GFXDebuggerCheckAndPause(bool update) if (GFXDebuggerPauseFlag) { g_pdebugger->OnPause(); - while( GFXDebuggerPauseFlag ) + while ( GFXDebuggerPauseFlag ) { g_video_backend->UpdateFPSDisplay("Paused by Video Debugger"); @@ -93,7 +93,7 @@ void GFXDebuggerBase::DumpPixelShader(const char* path) } else { - if(g_ActiveConfig.backend_info.bSupportsDualSourceBlend) + if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend) { output = "Using dual source blending for destination alpha:\n"; /// output += GeneratePixelShaderCode(DSTALPHA_DUAL_SOURCE_BLEND, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components); -- cgit v1.2.3 From a82675b7d581421fa80d5d5c53253cf1d5c1a26d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Mar 2014 15:33:41 -0400 Subject: Kill off some usages of c_str. Also changes some function params, but this is ok. Some simplifications were also able to be made (ie. killing off strcmps with ==, etc). --- Source/Core/VideoCommon/Debugger.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 98db44bd05..3197c5dd85 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include + #include "Common/FileUtil.h" #include "Common/IniFile.h" @@ -79,10 +81,9 @@ void ContinueGFXDebugger() } -void GFXDebuggerBase::DumpPixelShader(const char* path) +void GFXDebuggerBase::DumpPixelShader(const std::string& path) { - char filename[MAX_PATH]; - sprintf(filename, "%sdump_ps.txt", path); + const std::string filename = StringFromFormat("%sdump_ps.txt", path.c_str()); std::string output; bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; @@ -111,51 +112,50 @@ void GFXDebuggerBase::DumpPixelShader(const char* path) File::WriteStringToFile(output, filename); } -void GFXDebuggerBase::DumpVertexShader(const char* path) +void GFXDebuggerBase::DumpVertexShader(const std::string& path) { - char filename[MAX_PATH]; - sprintf(filename, "%sdump_vs.txt", path); + const std::string filename = StringFromFormat("%sdump_vs.txt", path.c_str()); File::CreateEmptyFile(filename); /// File::WriteStringToFile(GenerateVertexShaderCode(g_nativeVertexFmt->m_components, g_ActiveConfig.backend_info.APIType), filename); } -void GFXDebuggerBase::DumpPixelShaderConstants(const char* path) +void GFXDebuggerBase::DumpPixelShaderConstants(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpVertexShaderConstants(const char* path) +void GFXDebuggerBase::DumpVertexShaderConstants(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpTextures(const char* path) +void GFXDebuggerBase::DumpTextures(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpFrameBuffer(const char* path) +void GFXDebuggerBase::DumpFrameBuffer(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpGeometry(const char* path) +void GFXDebuggerBase::DumpGeometry(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpVertexDecl(const char* path) +void GFXDebuggerBase::DumpVertexDecl(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpMatrices(const char* path) +void GFXDebuggerBase::DumpMatrices(const std::string& path) { // TODO } -void GFXDebuggerBase::DumpStats(const char* path) +void GFXDebuggerBase::DumpStats(const std::string& path) { // TODO } -- cgit v1.2.3 From 8941f19cdb01bbe8c40851240d02019ed6e13a32 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 23 Mar 2014 21:44:23 +0100 Subject: BPMemory: Expose the pixel_format and zformat fields in PE_CONTROL as enumerations. --- Source/Core/VideoCommon/Debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 3197c5dd85..c5ca50f132 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -86,7 +86,7 @@ void GFXDebuggerBase::DumpPixelShader(const std::string& path) const std::string filename = StringFromFormat("%sdump_ps.txt", path.c_str()); std::string output; - bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && 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 == PEControl::RGBA6_Z24; if (!useDstAlpha) { output = "Destination alpha disabled:\n"; -- cgit v1.2.3 From 81ed17be53e7fed93147dc0d334a6c1d45f4e3c8 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 8 Jul 2014 16:49:33 +0200 Subject: avoid the extern keyword in .cpp files --- Source/Core/VideoCommon/Debugger.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index c5ca50f132..b5dcca740f 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -15,7 +15,6 @@ #include "VideoCommon/VideoConfig.h" //void UpdateFPSDisplay(const char *text); -extern NativeVertexFormat *g_nativeVertexFmt; GFXDebuggerBase *g_pdebugger = nullptr; volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again -- cgit v1.2.3 From 63f1a169696a9b9b519f3be4ee47ee7253f645a7 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 6 Aug 2014 22:38:39 -0400 Subject: Core: Remove UpdateFPSDisplay This is effectively unused, as the window handles that we pass to the GLInterface are window handles for the frame which isn't ever a real toplevel window. Host_UpdateTitle is what actually sets the proper title on the render window. --- Source/Core/VideoCommon/Debugger.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index b5dcca740f..41e263c1e1 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -14,8 +14,6 @@ #include "VideoCommon/VertexShaderGen.h" #include "VideoCommon/VideoConfig.h" -//void UpdateFPSDisplay(const char *text); - GFXDebuggerBase *g_pdebugger = nullptr; volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE; // Event which will trigger spin locking the GFX thread @@ -57,8 +55,6 @@ void GFXDebuggerCheckAndPause(bool update) g_pdebugger->OnPause(); while ( GFXDebuggerPauseFlag ) { - g_video_backend->UpdateFPSDisplay("Paused by Video Debugger"); - if (update) GFXDebuggerUpdateScreen(); SLEEP(5); } -- cgit v1.2.3 From cefcb0ace9d363b3679b4e93bcc9ec05f1e5f4f8 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 18 May 2015 01:08:10 +0200 Subject: Update license headers to GPLv2+ --- Source/Core/VideoCommon/Debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 41e263c1e1..5ea39bb4f5 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -1,5 +1,5 @@ // Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 +// Licensed under GPLv2+ // Refer to the license.txt file included. #include -- cgit v1.2.3 From 30ebb2459eb97ba544547183854775df8460b475 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 24 May 2015 06:55:12 +0200 Subject: Set copyright year to when a file was created --- Source/Core/VideoCommon/Debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Debugger.cpp') diff --git a/Source/Core/VideoCommon/Debugger.cpp b/Source/Core/VideoCommon/Debugger.cpp index 5ea39bb4f5..0c88be57f5 100644 --- a/Source/Core/VideoCommon/Debugger.cpp +++ b/Source/Core/VideoCommon/Debugger.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2010 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -- cgit v1.2.3