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:
Unknown W. Brackets committed 2014-05-25 18:18:26 -07:00
1 parent c3efa05c9e
commit c42d04829f
2 files changed
+25 -1

No files matched your search

+24 -1
View File
@@ -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
+1
View File
@@ -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_;