D3D11: Implement some PE pixel performance metrics.

Super Mario Sunshine is using a cool trick: To determine how much goop has been cleaned in ep. 6 of Sirena Beach, it counts the number of pixels that are input to the blending stage. For that it's using the PE performance registers ;)

Fixes issue 1498.
This commit is contained in:
NeoBrainX
2012-05-29 13:54:20 +02:00
parent 90af798d3d
commit 4d8d86bd6a
14 changed files with 245 additions and 36 deletions

View File

@ -62,7 +62,6 @@ void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xf
{
Renderer::RenderToXFB(xfbAddr, dstWidth, dstHeight, rc, gamma);
}
void BPWritten(const BPCmd& bp)
{
/*
@ -141,7 +140,8 @@ void BPWritten(const BPCmd& bp)
|| bp.address == BPMEM_LOADTLUT0
|| bp.address == BPMEM_LOADTLUT1
|| bp.address == BPMEM_TEXINVALIDATE
|| bp.address == BPMEM_PRELOAD_MODE))
|| bp.address == BPMEM_PRELOAD_MODE
|| bp.address == BPMEM_CLEAR_PIXEL_PERF))
{
return;
}
@ -265,6 +265,8 @@ void BPWritten(const BPCmd& bp)
UPE_Copy PE_copy = bpmem.triggerEFBCopy;
g_renderer->ResumePixelPerf(true);
// Check if we are to copy from the EFB or draw to the XFB
if (PE_copy.copy_to_xfb == 0)
{
@ -303,6 +305,8 @@ void BPWritten(const BPCmd& bp)
s_gammaLUT[PE_copy.gamma]);
}
g_renderer->PausePixelPerf(true);
// Clear the rectangular region after copying it.
if (PE_copy.clear)
{
@ -481,8 +485,9 @@ void BPWritten(const BPCmd& bp)
case BPMEM_REVBITS: // Always set to 0x0F when GX_InitRevBits() is called.
break;
case BPMEM_UNKNOWN_57: // Sunshine alternates this register between values 0x000 and 0xAAA
DEBUG_LOG(VIDEO, "Unknown BP Reg 0x57: %08x", bp.newvalue);
case BPMEM_CLEAR_PIXEL_PERF:
// GXClearPixMetric writes 0xAAA here, Sunshine alternates this register between values 0x000 and 0xAAA
g_renderer->ResetPixelPerf();
break;
case BPMEM_PRELOAD_ADDR: