Skip to content

Commit

Permalink
Document Syphon Filter hack, but don't enable it
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Feb 7, 2023
1 parent bfead16 commit 00e2e59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions GPU/Common/DepthBufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,18 @@ bool FramebufferManagerCommon::ReadbackDepthbuffer(Draw::Framebuffer *fbo, int x

DepthUB ub{};

// Setting this to 0.95f eliminates flickering lights with delayed readback in Syphon Filter.
// That's pretty ugly though! But we'll need to do that if we're gonna enable delayed readback in those games.
const float fudgeFactor = 1.0f;

if (!gstate_c.Use(GPU_USE_ACCURATE_DEPTH)) {
// Don't scale anything, since we're not using factors outside accurate mode.
ub.u_depthFactor[0] = 0.0f;
ub.u_depthFactor[1] = 1.0f;
ub.u_depthFactor[1] = fudgeFactor;
} else {
const float factor = DepthSliceFactor();
ub.u_depthFactor[0] = -0.5f * (factor - 1.0f) * (1.0f / factor);
ub.u_depthFactor[1] = factor;
ub.u_depthFactor[1] = factor * fudgeFactor;
}
static constexpr float shifts[] = { 16777215.0f, 16777215.0f / 256.0f, 16777215.0f / 65536.0f, 16777215.0f / 16777216.0f };
memcpy(ub.u_depthShift, shifts, sizeof(shifts));
Expand Down

0 comments on commit 00e2e59

Please sign in to comment.