mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Move out Cg shader generators to VideoCommon (hope to use this in the DX plugin in the future). Also move out stats code. Comment a lot and cleanup. Kill DX9 Globals.cpp.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@938 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
#include "D3DBase.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "Common.h"
|
||||
#include "Profiler.h"
|
||||
#include "BPStructs.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "IniFile.h"
|
||||
|
||||
Config g_Config;
|
||||
@ -80,5 +80,3 @@ void Config::Save()
|
||||
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
||||
iniFile.Save("gfx_dx9.ini");
|
||||
}
|
||||
|
||||
Statistics stats;
|
@ -62,65 +62,6 @@ struct Config
|
||||
std::string texDumpPath;
|
||||
};
|
||||
|
||||
|
||||
extern Config g_Config;
|
||||
|
||||
|
||||
struct Statistics
|
||||
{
|
||||
int numPrimitives;
|
||||
|
||||
int numPixelShadersCreated;
|
||||
int numPixelShadersAlive;
|
||||
int numVertexShadersCreated;
|
||||
int numVertexShadersAlive;
|
||||
|
||||
int numTexturesCreated;
|
||||
int numTexturesAlive;
|
||||
|
||||
int numRenderTargetsCreated;
|
||||
int numRenderTargetsAlive;
|
||||
|
||||
int numDListsCalled;
|
||||
int numDListsCreated;
|
||||
int numDListsAlive;
|
||||
|
||||
int numJoins;
|
||||
|
||||
struct ThisFrame
|
||||
{
|
||||
int numBPLoads;
|
||||
int numCPLoads;
|
||||
int numXFLoads;
|
||||
|
||||
int numBPLoadsInDL;
|
||||
int numCPLoadsInDL;
|
||||
int numXFLoadsInDL;
|
||||
|
||||
int numDLs;
|
||||
int numDLPrims;
|
||||
int numPrims;
|
||||
int numShaderChanges;
|
||||
int numBadCommands; //hope this always is zero ;)
|
||||
|
||||
int numDListsCalled;
|
||||
};
|
||||
ThisFrame thisFrame;
|
||||
void ResetFrame() {memset(&thisFrame,0,sizeof(ThisFrame));}
|
||||
};
|
||||
|
||||
extern Statistics stats;
|
||||
|
||||
#define STATISTICS
|
||||
|
||||
#ifdef STATISTICS
|
||||
#define INCSTAT(a) (a)++;
|
||||
#define ADDSTAT(a,b) (a)+=(b);
|
||||
#define SETSTAT(a,x) (a)=(x);
|
||||
#else
|
||||
#define INCSTAT(a) ;
|
||||
#define ADDSTAT(a,b) ;
|
||||
#define SETSTAT(a,x) ;
|
||||
#endif
|
||||
|
||||
#endif
|
@ -21,7 +21,7 @@
|
||||
#include "D3DTexture.h"
|
||||
#include "D3DUtil.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "Render.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <d3dx9.h>
|
||||
#include <string>
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "D3DShader.h"
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "D3DBase.h"
|
||||
#include "D3DPostprocess.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "TextureCache.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "../../Core/Src/Core.h"
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "main.h"
|
||||
#include "EmuWindow.h"
|
||||
|
||||
|
@ -28,8 +28,8 @@
|
||||
#include "D3DBase.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "Statistics.h"
|
||||
#include "Profiler.h"
|
||||
#include "Globals.h"
|
||||
#include "VertexHandler.h"
|
||||
#include "TransformEngine.h"
|
||||
#include "OpcodeDecoding.h"
|
||||
@ -72,10 +72,7 @@ void ExecuteDisplayList(u32 address, u32 size)
|
||||
g_pVideoData = startAddress;
|
||||
|
||||
// temporarily swap dl and non-dl(small "hack" for the stats)
|
||||
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
||||
Statistics::SwapDL();
|
||||
|
||||
while((u32)(g_pVideoData - startAddress) < size)
|
||||
{
|
||||
@ -85,10 +82,7 @@ void ExecuteDisplayList(u32 address, u32 size)
|
||||
INCSTAT(stats.thisFrame.numDListsCalled);
|
||||
|
||||
// un-swap
|
||||
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
||||
Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
||||
Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
||||
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
||||
Statistics::SwapDL();
|
||||
|
||||
// reset to the old pointer
|
||||
g_pVideoData = old_pVideoData;
|
||||
|
@ -15,7 +15,6 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
#include "PixelShader.h"
|
||||
#include "BPStructs.h"
|
||||
#include "XFStructs.h"
|
||||
|
@ -18,8 +18,9 @@
|
||||
#include <d3dx9.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Statistics.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "main.h"
|
||||
#include "VertexHandler.h"
|
||||
#include "Render.h"
|
||||
@ -209,7 +210,6 @@ void Renderer::SwapBuffers(void)
|
||||
p+=sprintf(p,"Num strip joins: %i\n",stats.numJoins);
|
||||
p+=sprintf(p,"Num primitives: %i\n",stats.thisFrame.numPrims);
|
||||
p+=sprintf(p,"Num primitives (DL): %i\n",stats.thisFrame.numDLPrims);
|
||||
p+=sprintf(p,"Num bad commands: %i%s\n",stats.thisFrame.numBadCommands,stats.thisFrame.numBadCommands?"!!!":"");
|
||||
p+=sprintf(p,"Num XF loads: %i\n",stats.thisFrame.numXFLoads);
|
||||
p+=sprintf(p,"Num XF loads (DL): %i\n",stats.thisFrame.numXFLoadsInDL);
|
||||
p+=sprintf(p,"Num CP loads: %i\n",stats.thisFrame.numCPLoads);
|
||||
|
@ -16,9 +16,9 @@
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "D3DBase.h"
|
||||
#include "Statistics.h"
|
||||
#include "Utils.h"
|
||||
#include "Profiler.h"
|
||||
#include "Globals.h"
|
||||
#include "ShaderManager.h"
|
||||
#include "VertexLoader.h"
|
||||
#include "BPMemory.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <d3dx9.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Statistics.h"
|
||||
|
||||
#include "D3DBase.h"
|
||||
#include "D3DTexture.h"
|
||||
@ -27,7 +28,7 @@
|
||||
#include "TextureDecoder.h"
|
||||
#include "TextureCache.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "main.h"
|
||||
|
||||
u8 *TextureCache::temp = NULL;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "Profiler.h"
|
||||
#include "Globals.h"
|
||||
// #include "Globals.h"
|
||||
#include "Vec3.h"
|
||||
#include "TransformEngine.h"
|
||||
#include "VertexHandler.h"
|
||||
|
@ -15,11 +15,12 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "D3DBase.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "Statistics.h"
|
||||
#include "Profiler.h"
|
||||
#include "Globals.h"
|
||||
#include "VertexHandler.h"
|
||||
#include "OpcodeDecoding.h"
|
||||
#include "TransformEngine.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "svnrev.h"
|
||||
#include "resource.h"
|
||||
#include "main.h"
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "Fifo.h"
|
||||
#include "OpcodeDecoding.h"
|
||||
#include "TextureCache.h"
|
||||
|
Reference in New Issue
Block a user