GPU:
- Once again, tell the 3D renderer which framebuffers need to be flushed per frame so that we can avoid flushing unneeded framebuffers. This fixes a performance regression with many 3D games. (Regression from r5383.)
This commit is contained in:
parent
e6dac5ec96
commit
9683b7e070
|
@ -7378,8 +7378,12 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
|
|||
// originates from the top of the screen, the BG0 layer will only be enabled at line 46. This
|
||||
// means that we need to check the states at that particular time to ensure that the 3D renderer
|
||||
// finishes before we read the 3D framebuffer. Otherwise, the map will render incorrectly.
|
||||
if ( CurrentRenderer->GetRenderNeedsFinish() && (this->_engineMain->WillRender3DLayer() || this->_engineMain->WillCapture3DLayerDirect()) )
|
||||
const bool need3DDisplayFramebuffer = this->_engineMain->WillRender3DLayer();
|
||||
const bool need3DCaptureFramebuffer = this->_engineMain->WillCapture3DLayerDirect();
|
||||
|
||||
if ( CurrentRenderer->GetRenderNeedsFinish() && (need3DDisplayFramebuffer || need3DCaptureFramebuffer) )
|
||||
{
|
||||
CurrentRenderer->SetFramebufferFlushStates(need3DDisplayFramebuffer, need3DCaptureFramebuffer);
|
||||
CurrentRenderer->RenderFinish();
|
||||
CurrentRenderer->SetRenderNeedsFinish(false);
|
||||
this->_event->DidRender3DEnd();
|
||||
|
|
|
@ -2260,9 +2260,13 @@ void gfx3d_VBlankEndSignal(bool skipFrame)
|
|||
|
||||
if (CurrentRenderer->GetRenderNeedsFinish())
|
||||
{
|
||||
bool need3DDisplayFramebuffer;
|
||||
bool need3DCaptureFramebuffer;
|
||||
CurrentRenderer->GetFramebufferFlushStates(need3DDisplayFramebuffer, need3DCaptureFramebuffer);
|
||||
|
||||
CurrentRenderer->SetFramebufferFlushStates(false, false);
|
||||
CurrentRenderer->RenderFinish();
|
||||
CurrentRenderer->SetFramebufferFlushStates(true, true);
|
||||
CurrentRenderer->SetFramebufferFlushStates(need3DDisplayFramebuffer, need3DCaptureFramebuffer);
|
||||
CurrentRenderer->SetRenderNeedsFinish(false);
|
||||
GPU->GetEventHandler()->DidRender3DEnd();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue