Added an EFB peek cache to the GL video plugin

Most of the games using EFB peeks are suffering from major performance problems
when these peeks are not disabled in the graphics settings. This is an attempt
to fix this in the GL renderer by doing the glReadPixels in bulk: instead of
doing a lot of 1x1 pixel reads, read for 64x64 pixels at once and keep that in
a cache.

Deck menu in Baten Kaitos: 3FPS -> 54FPS
Character creation in Monster Hunter Tri: 7FPS -> 60FPS
This commit is contained in:
Pierre Bourdon
2011-08-22 06:15:02 +02:00
parent 3fc5d8d7cf
commit 1e558aedeb
3 changed files with 107 additions and 28 deletions

View File

@ -7,6 +7,8 @@
namespace OGL
{
void ClearEFBCache();
class Renderer : public ::Renderer
{
public:
@ -57,6 +59,9 @@ public:
void SetVSConstant4fv(unsigned int const_number, const float *f);
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f);
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f);
private:
void UpdateEFBCache(EFBAccessType type, u32 cacheRectIdx, const EFBRectangle& efbPixelRc, const TargetRectangle& targetPixelRc, const u32* data);
};
}