Fix debug mode build, fix some profile stuff to not get compiled when profiling is off, cleaned a bit.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@941 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
4b2c7310b7
commit
4d169987c2
|
@ -48,6 +48,7 @@ void DVProfClear(); // clears all the profilers
|
|||
#endif
|
||||
|
||||
#define DVSTARTPROFILE() DVProfileFunc _pf(__PRETTY_FUNCTION__);
|
||||
#define DVSTARTSUBPROFILE(name) DVProfileFunc _pf(name);
|
||||
|
||||
class DVProfileFunc
|
||||
{
|
||||
|
@ -61,6 +62,7 @@ public:
|
|||
#else
|
||||
|
||||
#define DVSTARTPROFILE()
|
||||
#define DVSTARTSUBPROFILE(name)
|
||||
|
||||
class DVProfileFunc
|
||||
{
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
// and hope that the vertex format doesn't change, though, if you do it just when they are
|
||||
// called. The reason is that the vertex format affects the sizes of the vertices.
|
||||
|
||||
|
||||
#include "D3DBase.h"
|
||||
|
||||
#include "Common.h"
|
||||
|
@ -35,39 +34,25 @@
|
|||
#include "OpcodeDecoding.h"
|
||||
#include "TextureCache.h"
|
||||
#include "ShaderManager.h"
|
||||
#include "DecodedVArray.h"
|
||||
|
||||
#include "BPStructs.h"
|
||||
#include "XFStructs.h"
|
||||
#include "Utils.h"
|
||||
#include "main.h"
|
||||
#include "Fifo.h"
|
||||
#include "DataReader.h"
|
||||
|
||||
#include "DLCompiler.h"
|
||||
|
||||
#define CMDBUFFER_SIZE 1024*1024
|
||||
|
||||
DecodedVArray tempvarray;
|
||||
u8 *g_pVideoData = 0;
|
||||
|
||||
extern u8* FAKE_GetFifoStartPtr();
|
||||
extern u8* FAKE_GetFifoEndPtr();
|
||||
|
||||
void Decode();
|
||||
static void Decode();
|
||||
|
||||
template <class T>
|
||||
void Xchg(T& a, T&b)
|
||||
{
|
||||
T c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
void ExecuteDisplayList(u32 address, u32 size)
|
||||
static void ExecuteDisplayList(u32 address, u32 size)
|
||||
{
|
||||
u8* old_pVideoData = g_pVideoData;
|
||||
|
||||
|
||||
u8* startAddress = Memory_GetPtr(address);
|
||||
g_pVideoData = startAddress;
|
||||
|
||||
|
@ -88,7 +73,7 @@ void ExecuteDisplayList(u32 address, u32 size)
|
|||
g_pVideoData = old_pVideoData;
|
||||
}
|
||||
|
||||
bool FifoCommandRunnable(void)
|
||||
bool FifoCommandRunnable()
|
||||
{
|
||||
u32 iBufferSize = (u32)(FAKE_GetFifoEndPtr()-g_pVideoData);
|
||||
if (iBufferSize == 0)
|
||||
|
@ -224,15 +209,15 @@ bool FifoCommandRunnable(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
void Decode(void)
|
||||
static void Decode(void)
|
||||
{
|
||||
int Cmd = DataReadU8();
|
||||
switch(Cmd)
|
||||
switch (Cmd)
|
||||
{
|
||||
case GX_NOP:
|
||||
break;
|
||||
|
||||
case GX_LOAD_CP_REG: //0x08
|
||||
case GX_LOAD_CP_REG:
|
||||
{
|
||||
u32 SubCmd = DataReadU8();
|
||||
u32 Value = DataReadU32();
|
||||
|
|
|
@ -419,7 +419,7 @@ void BPWritten(int addr, int changes, int newval)
|
|||
|
||||
case 0x52:
|
||||
{
|
||||
DVProfileFunc _pf("LoadBPReg:swap");
|
||||
DVSTARTSUBPROFILE("LoadBPReg:swap");
|
||||
VertexManager::Flush();
|
||||
|
||||
((u32*)&bpmem)[addr] = newval;
|
||||
|
@ -524,7 +524,7 @@ void BPWritten(int addr, int changes, int newval)
|
|||
|
||||
case 0x65: //GXLoadTlut
|
||||
{
|
||||
DVProfileFunc _pf("LoadBPReg:GXLoadTlut");
|
||||
DVSTARTSUBPROFILE("LoadBPReg:GXLoadTlut");
|
||||
VertexManager::Flush();
|
||||
((u32*)&bpmem)[addr] = newval;
|
||||
|
||||
|
|
|
@ -27,25 +27,25 @@
|
|||
#include "Globals.h"
|
||||
#include "Profiler.h"
|
||||
#include "OpcodeDecoding.h"
|
||||
|
||||
#include "VertexLoader.h"
|
||||
#include "VertexManager.h"
|
||||
#include "VertexShaderManager.h"
|
||||
|
||||
#include "Statistics.h"
|
||||
|
||||
#include "BPStructs.h"
|
||||
#include "Fifo.h"
|
||||
#include "DataReader.h"
|
||||
|
||||
#define CMDBUFFER_SIZE 1024*1024
|
||||
|
||||
u8* g_pVideoData = 0;
|
||||
|
||||
extern u8* FAKE_GetFifoStartPtr();
|
||||
extern u8* FAKE_GetFifoEndPtr();
|
||||
|
||||
void Decode();
|
||||
static void Decode();
|
||||
|
||||
void ExecuteDisplayList(u32 address, u32 size)
|
||||
static void ExecuteDisplayList(u32 address, u32 size)
|
||||
{
|
||||
u8* old_pVideoData = g_pVideoData;
|
||||
|
||||
|
@ -69,7 +69,7 @@ void ExecuteDisplayList(u32 address, u32 size)
|
|||
g_pVideoData = old_pVideoData;
|
||||
}
|
||||
|
||||
bool FifoCommandRunnable(void)
|
||||
bool FifoCommandRunnable()
|
||||
{
|
||||
u32 iBufferSize = (u32)(FAKE_GetFifoEndPtr() - g_pVideoData);
|
||||
if (iBufferSize == 0)
|
||||
|
@ -198,7 +198,7 @@ bool FifoCommandRunnable(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
void Decode(void)
|
||||
static void Decode()
|
||||
{
|
||||
int Cmd = DataReadU8();
|
||||
switch(Cmd)
|
||||
|
@ -230,16 +230,16 @@ void Decode(void)
|
|||
break;
|
||||
|
||||
case GX_LOAD_INDX_A: //used for position matrices
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(),0xC);
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(), 0xC);
|
||||
break;
|
||||
case GX_LOAD_INDX_B: //used for normal matrices
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(),0xD);
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(), 0xD);
|
||||
break;
|
||||
case GX_LOAD_INDX_C: //used for postmatrices
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(),0xE);
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(), 0xE);
|
||||
break;
|
||||
case GX_LOAD_INDX_D: //used for lights
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(),0xF);
|
||||
VertexShaderMngr::LoadIndexedXF(DataReadU32(), 0xF);
|
||||
break;
|
||||
|
||||
case GX_CMD_CALL_DL:
|
||||
|
@ -268,7 +268,7 @@ void Decode(void)
|
|||
|
||||
// draw primitives
|
||||
default:
|
||||
if (Cmd&0x80)
|
||||
if (Cmd & 0x80)
|
||||
{
|
||||
// load vertices (use computed vertex size from FifoCommandRunnable above)
|
||||
u16 numVertices = DataReadU16();
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <cmath>
|
||||
|
||||
#include "Statistics.h"
|
||||
#include "Config.h"
|
||||
#include "ImageWrite.h"
|
||||
#include "Common.h"
|
||||
#include "Render.h"
|
||||
|
|
|
@ -688,7 +688,7 @@ void Renderer::Swap(const TRectangle& rc)
|
|||
{
|
||||
OpenGL_Update(); // just updates the render window position and the backbuffer size
|
||||
|
||||
DVProfileFunc _pf("Renderer::Swap");
|
||||
DVSTARTPROFILE();
|
||||
|
||||
Renderer::SetRenderMode(Renderer::RM_Normal);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "ImageWrite.h"
|
||||
#include "x64Emitter.h"
|
||||
#include "ABI.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
#include "Config.h"
|
||||
#include "VertexLoader.h"
|
||||
#include "VertexManager.h"
|
||||
#include "VertexLoader_Normal.h"
|
||||
|
|
|
@ -125,8 +125,8 @@ void VertexManager::Flush()
|
|||
_assert_(s_pCurBufferPointer != s_pBaseBufferPointer);
|
||||
|
||||
#ifdef _DEBUG
|
||||
PRIM_LOG("frame%d:\ncomps=0x%x, texgen=%d, numchan=%d, dualtex=%d, ztex=%d, proj=%d, cole=%d, alpe=%d, ze=%d\n", g_Config.iSaveTargetId, s_prevcomponents, xfregs.numTexGens,
|
||||
xfregs.nNumChans, (int)xfregs.bEnableDualTexTransform, bpmem.ztex2.op, VertexShaderMngr::rawProjection[6]==0,
|
||||
PRIM_LOG("frame%d:\ncomps=0x%x, texgen=%d, numchan=%d, dualtex=%d, ztex=%d, cole=%d, alpe=%d, ze=%d\n", g_Config.iSaveTargetId, s_prevcomponents, xfregs.numTexGens,
|
||||
xfregs.nNumChans, (int)xfregs.bEnableDualTexTransform, bpmem.ztex2.op,
|
||||
bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.zmode.updateenable);
|
||||
for (int i = 0; i < xfregs.nNumChans; ++i) {
|
||||
LitChannel* ch = &xfregs.colChans[i].color;
|
||||
|
@ -163,7 +163,7 @@ void VertexManager::Flush()
|
|||
|
||||
// set the textures
|
||||
{
|
||||
DVProfileFunc _pf("VertexManager::Flush:textures");
|
||||
DVSTARTPROFILE("VertexManager::Flush:textures");
|
||||
|
||||
u32 usedtextures = 0;
|
||||
for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; ++i) {
|
||||
|
@ -275,7 +275,7 @@ void VertexManager::Flush()
|
|||
std::ofstream fps(strfile);
|
||||
fps << ps->strprog.c_str();
|
||||
sprintf(strfile, "frames/vs%.3d.txt", g_Config.iSaveTargetId);
|
||||
ofstream fvs(strfile);
|
||||
std::ofstream fvs(strfile);
|
||||
fvs << vs->strprog.c_str();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue