Avoid framebuffer lookups for repeated prims.

There are usually many prims per framebuffer.  This cuts time spent in
SetRenderFramebuffer() from 1% to 0.13% (although a bit more time in
ExecuteOp, not much.)
This commit is contained in:
Unknown W. Brackets 2013-04-21 15:08:47 -07:00
parent b84dadfd3a
commit 85a23dac63
3 changed files with 13 additions and 0 deletions

View file

@ -290,6 +290,12 @@ void GuessDrawingSize(int &drawing_width, int &drawing_height) {
}
void FramebufferManager::SetRenderFrameBuffer() {
if (!gstate_c.framebufChanged && currentRenderVfb_) {
currentRenderVfb_->last_frame_used = gpuStats.numFrames;
return;
}
gstate_c.framebufChanged = false;
// Get parameters
u32 fb_address = (gstate.fbptr & 0xFFE000) | ((gstate.fbwidth & 0xFF0000) << 8);
int fb_stride = gstate.fbwidth & 0x3C0;