Fix DiRT 2's car reflections.

This commit is contained in:
Henrik Rydgård 2020-12-13 00:19:39 +01:00
parent 63b945ccc4
commit 2f700aa495
2 changed files with 21 additions and 7 deletions

View file

@ -536,10 +536,14 @@ void FramebufferManagerCommon::ReinterpretFramebufferFrom(VirtualFramebuffer *vf
// Fixes #13717.
if (!PSP_CoreParameter().compat.flags().ReinterpretFramebuffers) {
draw_->BindFramebufferAsRenderTarget(vfb->fbo, { Draw::RPAction::CLEAR, Draw::RPAction::KEEP, Draw::RPAction::CLEAR }, "FakeReinterpret");
currentRenderVfb_ = vfb;
// Need to dirty anything that has command buffer dynamic state, in case we started a new pass above.
// Should find a way to feed that information back, maybe... Or simply correct the issue in the rendermanager.
gstate_c.Dirty(DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE);
if (currentRenderVfb_ != vfb) {
// In case ReinterpretFramebuffer was called from the texture manager.
draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "After FakeReinterpret");
}
}
}
return;
@ -626,13 +630,16 @@ void FramebufferManagerCommon::ReinterpretFramebufferFrom(VirtualFramebuffer *vf
// Unbind.
draw_->BindTexture(0, nullptr);
RebindFramebuffer("After reinterpret");
shaderManager_->DirtyLastShader();
textureCache_->ForgetLastTexture();
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_VERTEXSHADER_STATE);
if (currentRenderVfb_ != vfb) {
// In case ReinterpretFramebuffer was called from the texture manager.
draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "After reinterpret");
}
delete[] vsCode;
delete[] fsCode;
}

View file

@ -819,15 +819,16 @@ NPEZ00198 = true
# This setting will go away in the near future, hopefully we can enable it
# for all or most games.
[ReinterpretFramebuffers]
# Outrun 2006: Coast to Coast - issue #11358
# Outrun 2006: Coast to Coast - issue #11358 (car reflections)
ULES00262 = true
ULUS10064 = true
ULKS46087 = true
# Colin McRae's DiRT 2?
# ULUS10471 = true
# ULJM05533 = true
# NPJH50006 = true
# Colin McRae's DiRT 2 - issue #13012 (car lighting)
ULUS10471 = true
ULJM05533 = true
NPJH50006 = true
ULES01301 = true
# Ultimate Ghosts & Goblins
ULJM05147 = true
@ -845,6 +846,12 @@ ULES00262 = true
ULUS10064 = true
ULKS46087 = true
# Colin McRae's DiRT 2 - issue #13012 (car lighting)
ULUS10471 = true
ULJM05533 = true
NPJH50006 = true
ULES01301 = true
[DoublePrecisionSinCos]
# Hitman Reborn Battle Arena 2 (#12900)
ULJS00218 = true