mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 15:00:30 +02:00
Detect if the game uses block transfer slivers.
In that case, it's better to read it once, than multiple times. Improves performance and graphics in Grand Knights History.
This commit is contained in:
1 parent
c3efa05c9e
commit
c42d04829f
2 files changed
+25
-1
No files matched your search
@@ -328,6 +328,7 @@ FramebufferManager::FramebufferManager() :
|
||||
usePostShader_(false),
|
||||
postShaderAtOutputResolution_(false),
|
||||
resized_(false),
|
||||
gameUsesSequentialCopies_(false),
|
||||
framebufRangeEnd_(0)
|
||||
#ifndef USING_GLES2
|
||||
,
|
||||
@@ -1240,7 +1241,29 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s
|
||||
#endif
|
||||
}
|
||||
|
||||
vfb->memoryUpdated = true;
|
||||
if (gameUsesSequentialCopies_) {
|
||||
// Ignore the x/y/etc., read the entire thing.
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = vfb->width;
|
||||
h = vfb->height;
|
||||
}
|
||||
if (x == 0 && y == 0 && w == vfb->width && h == vfb->height) {
|
||||
vfb->memoryUpdated = true;
|
||||
} else {
|
||||
const static int FREQUENT_SEQUENTIAL_COPIES = 3;
|
||||
static int frameLastCopy = 0;
|
||||
static u32 bufferLastCopy = 0;
|
||||
static int copiesThisFrame = 0;
|
||||
if (frameLastCopy != gpuStats.numFlips || bufferLastCopy != vfb->fb_address) {
|
||||
frameLastCopy = gpuStats.numFlips;
|
||||
bufferLastCopy = vfb->fb_address;
|
||||
copiesThisFrame = 0;
|
||||
}
|
||||
if (++copiesThisFrame > FREQUENT_SEQUENTIAL_COPIES) {
|
||||
gameUsesSequentialCopies_ = true;
|
||||
}
|
||||
}
|
||||
BlitFramebuffer_(nvfb, x, y, vfb, x, y, w, h, 0, true);
|
||||
|
||||
// PackFramebufferSync_() - Synchronous pixel data transfer using glReadPixels
|
||||
|
||||
@@ -272,6 +272,7 @@ private:
|
||||
bool resized_;
|
||||
bool useBufferedRendering_;
|
||||
bool updateVRAM_;
|
||||
bool gameUsesSequentialCopies_;
|
||||
|
||||
// The range of PSP memory that may contain FBOs. So we can skip iterating.
|
||||
u32 framebufRangeEnd_;
|
||||
|
||||
Reference in new issue
Block a user