From 5a77cae2e3434fa5cbb3710f183328e36620fa5f Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Fri, 18 May 2012 23:13:53 +0200 Subject: Check if BP and XF changes actually change values before flushing --- Source/Core/VideoCommon/Src/BPStructs.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp') diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index d59523e117..84f2426f26 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -128,7 +128,17 @@ void BPWritten(const BPCmd& bp) FlushPipeline(); } } // END ZTP SPEEDUP HACK - else FlushPipeline(); + else + { + if (((s32*)&bpmem)[bp.address] != bp.newvalue) + { + FlushPipeline(); + } + else if (bp.address == BPMEM_TRIGGER_EFB_COPY + || bp.address == BPMEM_CLEARBBOX1 + || bp.address == BPMEM_CLEARBBOX2) + FlushPipeline(); + } ((u32*)&bpmem)[bp.address] = bp.newvalue; -- cgit v1.2.3 From c95baf614d2699233b7bf7a474d96aa6c4cf2b78 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 20 May 2012 20:56:03 +0200 Subject: Avoid changing video state on useless BP writes When a game writes the same value that was already configured to a BP register, Dolphin previously flushed the GPU pipeline and reconfigured the internal video state (calling SetScissor/SetLineWidth/SetDepthMode). Some of these useless writes still need to perform actions, for example writes to the EFB copy trigger or the texture preload registers (which need to reload the texture from memory). --- Source/Core/VideoCommon/Src/BPStructs.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp') diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 84f2426f26..160ee1a61b 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -130,14 +130,24 @@ void BPWritten(const BPCmd& bp) } // END ZTP SPEEDUP HACK else { - if (((s32*)&bpmem)[bp.address] != bp.newvalue) + if (((s32*)&bpmem)[bp.address] == bp.newvalue) { - FlushPipeline(); + if (!(bp.address == BPMEM_TRIGGER_EFB_COPY + || bp.address == BPMEM_CLEARBBOX1 + || bp.address == BPMEM_CLEARBBOX2 + || bp.address == BPMEM_SETDRAWDONE + || bp.address == BPMEM_PE_TOKEN_ID + || bp.address == BPMEM_PE_TOKEN_INT_ID + || bp.address == BPMEM_LOADTLUT0 + || bp.address == BPMEM_LOADTLUT1 + || bp.address == BPMEM_TEXINVALIDATE + || bp.address == BPMEM_PRELOAD_MODE)) + { + return; + } } - else if (bp.address == BPMEM_TRIGGER_EFB_COPY - || bp.address == BPMEM_CLEARBBOX1 - || bp.address == BPMEM_CLEARBBOX2) - FlushPipeline(); + + FlushPipeline(); } ((u32*)&bpmem)[bp.address] = bp.newvalue; -- cgit v1.2.3