summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/BPStructs.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2012-05-24 21:49:37 +0200
committerPierre Bourdon <delroth@gmail.com>2012-05-24 21:49:37 +0200
commitcf69e7ca8ad711add7774b1db805848ef3bfd42b (patch)
tree7b78b823a61338455958a28bf77389c093a04a37 /Source/Core/VideoCommon/Src/BPStructs.cpp
parent4131ca8d386eb37533eb2863214bbc76de67e389 (diff)
parentfee2d83f68d92a6f3b7461b06f4dce2dbd6f1c07 (diff)
Merge branch 'gx-optimization'
This branch reduces the number of useless state flushes in the video emulation layer by checking whether a BP/XF change will have an effect or not. Greatly reduces the number of GL calls per frame. Thanks to degasus for his help!
Diffstat (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/BPStructs.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp
index d59523e117..160ee1a61b 100644
--- a/Source/Core/VideoCommon/Src/BPStructs.cpp
+++ b/Source/Core/VideoCommon/Src/BPStructs.cpp
@@ -128,7 +128,27 @@ void BPWritten(const BPCmd& bp)
FlushPipeline();
}
} // END ZTP SPEEDUP HACK
- else FlushPipeline();
+ else
+ {
+ if (((s32*)&bpmem)[bp.address] == bp.newvalue)
+ {
+ 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;
+ }
+ }
+
+ FlushPipeline();
+ }
((u32*)&bpmem)[bp.address] = bp.newvalue;