summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/BPStructs.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2012-05-29 13:54:20 +0200
committerNeoBrainX <NeoBrainX@gmail.com>2012-08-26 20:26:10 +0200
commit4d8d86bd6a27e9eea5bbf1440cbf317f02320519 (patch)
tree9669cbd4e31ef263725e1f120cc611c69f77111e /Source/Core/VideoCommon/Src/BPStructs.cpp
parent90af798d3d9e26d1fb588127242e767ef24c5eec (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/BPStructs.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp
index 179196e412..bc6de89bf2 100644
--- a/Source/Core/VideoCommon/Src/BPStructs.cpp
+++ b/Source/Core/VideoCommon/Src/BPStructs.cpp
@@ -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: