Skip to content

Commit

Permalink
GS: Fix half pixel offset normal upscaling above 8x.
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningterror committed Jul 7, 2024
1 parent 06c9c60 commit 404824e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pcsx2/GS/Renderers/Common/GSRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,22 @@ GSVector2i GSRenderer::GetInternalResolution()

float GSRenderer::GetModXYOffset()
{
float mod_xy = 0.0f;

if (GSConfig.UserHacks_HalfPixelOffset == GSHalfPixelOffset::Normal)
{
mod_xy = GetUpscaleMultiplier();
switch (static_cast<int>(std::round(mod_xy)))
float mod_xy = GetUpscaleMultiplier();
const int rounded_mod_xy = static_cast<int>(std::round(mod_xy));
if (rounded_mod_xy > 1)
{
case 2: case 4: case 6: case 8: mod_xy += 0.2f; break;
case 3: case 7: mod_xy += 0.1f; break;
case 5: mod_xy += 0.3f; break;
default: mod_xy = 0.0f; break;
if (!(rounded_mod_xy & 1))
return mod_xy += 0.2f;
else if (!(rounded_mod_xy & 2))
return mod_xy += 0.3f;
else
return mod_xy += 0.1f;
}
}

return mod_xy;
return 0.0f;
}

static float GetCurrentAspectRatioFloat(bool is_progressive)
Expand Down

0 comments on commit 404824e

Please sign in to comment.