Video_Software: Fix stuff.

This commit is contained in:
NeoBrainX 2012-08-27 23:51:35 +02:00
parent d734a5b486
commit 49d1da5e7e
5 changed files with 36 additions and 18 deletions

View File

@ -92,12 +92,18 @@ void SWBPWritten(int address, int newvalue)
break;
case BPMEM_CLEAR_PIXEL_PERF:
// TODO: Parameter?
SWPixelEngine::pereg.perfZcompInputZcomploc = 0;
SWPixelEngine::pereg.perfZcompOutputZcomploc = 0;
SWPixelEngine::pereg.perfZcompInput = 0;
SWPixelEngine::pereg.perfZcompOutput = 0;
SWPixelEngine::pereg.perfBlendInput = 0;
SWPixelEngine::pereg.perfEfbCopyClocks = 0;
SWPixelEngine::pereg.perfZcompInputZcomplocLo = 0;
SWPixelEngine::pereg.perfZcompInputZcomplocHi = 0;
SWPixelEngine::pereg.perfZcompOutputZcomplocLo = 0;
SWPixelEngine::pereg.perfZcompOutputZcomplocHi = 0;
SWPixelEngine::pereg.perfZcompInputLo = 0;
SWPixelEngine::pereg.perfZcompInputHi = 0;
SWPixelEngine::pereg.perfZcompOutputLo = 0;
SWPixelEngine::pereg.perfZcompOutputHi = 0;
SWPixelEngine::pereg.perfBlendInputLo = 0;
SWPixelEngine::pereg.perfBlendInputHi = 0;
SWPixelEngine::pereg.perfEfbCopyClocksLo = 0;
SWPixelEngine::pereg.perfEfbCopyClocksHi = 0;
break;
case BPMEM_LOADTLUT0: // This one updates bpmem.tlutXferSrc, no need to do anything here.
break;

View File

@ -129,14 +129,17 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi)
if (bpmem.zcontrol.zcomploc)
{
// TODO: Verify that perf regs are being incremented even if test is disabled
SWPixelEngine::pereg.perfZcompInputZcomploc++;
if (++SWPixelEngine::pereg.perfZcompInputZcomplocLo == 0)
SWPixelEngine::pereg.perfZcompInputZcomplocHi++;
if (bpmem.zmode.testenable)
{
// early z
if (!EfbInterface::ZCompare(x, y, z))
return;
}
SWPixelEngine::pereg.perfZcompOutputZcomploc++;
if (++SWPixelEngine::pereg.perfZcompOutputZcomplocLo == 0)
SWPixelEngine::pereg.perfZcompOutputZcomplocHi++;
}
RasterBlockPixel& pixel = rasterBlock.Pixel[xi][yi];

View File

@ -82,7 +82,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
if (address > 0x16)
{
ERROR_LOG(PIXELENGINE, "addr %#08x, ret %#08x; %#08x, %#08x, %#08x, %#08x, %#08x, %#08x\n", address, _uReturnValue, pereg.perfZcompInputZcomploc, pereg.perfZcompOutputZcomploc, pereg.perfZcompInput, pereg.perfZcompOutput, pereg.perfBlendInput, pereg.perfEfbCopyClocks);
ERROR_LOG(PIXELENGINE, "addr %#08x, ret %#08x\n", address, _uReturnValue);
}
}

View File

@ -146,12 +146,18 @@ namespace SWPixelEngine
u16 boxTop;
u16 boxBottom;
u16 perfZcompInputZcomploc;
u16 perfZcompOutputZcomploc;
u16 perfZcompInput;
u16 perfZcompOutput;
u16 perfBlendInput;
u16 perfEfbCopyClocks;
u16 perfZcompInputZcomplocLo;
u16 perfZcompInputZcomplocHi;
u16 perfZcompOutputZcomplocLo;
u16 perfZcompOutputZcomplocHi;
u16 perfZcompInputLo;
u16 perfZcompInputHi;
u16 perfZcompOutputLo;
u16 perfZcompOutputHi;
u16 perfBlendInputLo;
u16 perfBlendInputHi;
u16 perfEfbCopyClocksLo;
u16 perfEfbCopyClocksHi;
};
extern PEReg pereg;

View File

@ -787,13 +787,15 @@ void Tev::Draw()
if (!bpmem.zcontrol.zcomploc)
{
SWPixelEngine::pereg.perfZcompInput++;
if (++SWPixelEngine::pereg.perfZcompInputLo == 0)
SWPixelEngine::pereg.perfZcompInputHi++;
if (bpmem.zmode.testenable)
{
if (!EfbInterface::ZCompare(Position[0], Position[1], Position[2]))
return;
}
SWPixelEngine::pereg.perfZcompOutput++;
if (++SWPixelEngine::pereg.perfZcompOutputLo == 0)
SWPixelEngine::pereg.perfZcompOutputHi++;
}
#if ALLOW_TEV_DUMPS
@ -818,7 +820,8 @@ void Tev::Draw()
INCSTAT(swstats.thisFrame.tevPixelsOut);
SWPixelEngine::pereg.perfBlendInput++;
if (++SWPixelEngine::pereg.perfBlendInputLo)
SWPixelEngine::pereg.perfBlendInputHi++;
EfbInterface::BlendTev(Position[0], Position[1], output);
}