2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-03-12 19:33:41 +00:00
|
|
|
#include <string>
|
|
|
|
|
2010-12-05 14:15:36 +00:00
|
|
|
class GFXDebuggerBase
|
|
|
|
{
|
|
|
|
public:
|
2011-01-30 01:58:54 +00:00
|
|
|
virtual ~GFXDebuggerBase() {}
|
|
|
|
|
2010-12-05 14:15:36 +00:00
|
|
|
// if paused, debugging functions can be enabled
|
2014-09-11 17:00:40 +00:00
|
|
|
virtual void OnPause() {}
|
|
|
|
virtual void OnContinue() {}
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-03-12 19:33:41 +00:00
|
|
|
void DumpPixelShader(const std::string& path);
|
|
|
|
void DumpVertexShader(const std::string& path);
|
|
|
|
void DumpPixelShaderConstants(const std::string& path);
|
|
|
|
void DumpVertexShaderConstants(const std::string& path);
|
|
|
|
void DumpTextures(const std::string& path);
|
|
|
|
void DumpFrameBuffer(const std::string& path);
|
|
|
|
void DumpGeometry(const std::string& path);
|
|
|
|
void DumpVertexDecl(const std::string& path);
|
|
|
|
void DumpMatrices(const std::string& path);
|
|
|
|
void DumpStats(const std::string& path);
|
2010-12-05 14:15:36 +00:00
|
|
|
};
|
|
|
|
|
2014-03-12 19:33:41 +00:00
|
|
|
enum PauseEvent
|
|
|
|
{
|
2014-02-09 21:03:16 +00:00
|
|
|
NOT_PAUSE = 0,
|
|
|
|
NEXT_FRAME = 1<<0,
|
|
|
|
NEXT_FLUSH = 1<<1,
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-09 21:03:16 +00:00
|
|
|
NEXT_PIXEL_SHADER_CHANGE = 1<<2,
|
|
|
|
NEXT_VERTEX_SHADER_CHANGE = 1<<3,
|
|
|
|
NEXT_TEXTURE_CHANGE = 1<<4,
|
|
|
|
NEXT_NEW_TEXTURE = 1<<5,
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-09 21:03:16 +00:00
|
|
|
NEXT_XFB_CMD = 1<<6, // TODO
|
|
|
|
NEXT_EFB_CMD = 1<<7, // TODO
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-09 21:03:16 +00:00
|
|
|
NEXT_MATRIX_CMD = 1<<8, // TODO
|
|
|
|
NEXT_VERTEX_CMD = 1<<9, // TODO
|
|
|
|
NEXT_TEXTURE_CMD = 1<<10, // TODO
|
|
|
|
NEXT_LIGHT_CMD = 1<<11, // TODO
|
|
|
|
NEXT_FOG_CMD = 1<<12, // TODO
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-09 21:03:16 +00:00
|
|
|
NEXT_SET_TLUT = 1<<13, // TODO
|
2010-12-05 14:15:36 +00:00
|
|
|
|
2014-02-09 21:03:16 +00:00
|
|
|
NEXT_ERROR = 1<<14, // TODO
|
2010-12-05 14:15:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern GFXDebuggerBase *g_pdebugger;
|
|
|
|
extern volatile bool GFXDebuggerPauseFlag;
|
|
|
|
extern volatile PauseEvent GFXDebuggerToPauseAtNext;
|
|
|
|
extern volatile int GFXDebuggerEventToPauseCount;
|
|
|
|
void ContinueGFXDebugger();
|
|
|
|
void GFXDebuggerCheckAndPause(bool update);
|
|
|
|
void GFXDebuggerToPause(bool update);
|
|
|
|
void GFXDebuggerUpdateScreen();
|
|
|
|
|
|
|
|
#define GFX_DEBUGGER_PAUSE_AT(event,update) {if (((GFXDebuggerToPauseAtNext & event) && --GFXDebuggerEventToPauseCount<=0) || GFXDebuggerPauseFlag) GFXDebuggerToPause(update);}
|
|
|
|
#define GFX_DEBUGGER_PAUSE_LOG_AT(event,update,dumpfunc) {if (((GFXDebuggerToPauseAtNext & event) && --GFXDebuggerEventToPauseCount<=0) || GFXDebuggerPauseFlag) {{dumpfunc};GFXDebuggerToPause(update);}}
|
|
|
|
#define GFX_DEBUGGER_LOG_AT(event,dumpfunc) {if (( GFXDebuggerToPauseAtNext & event ) ) {{dumpfunc};}}
|