Skip to content

Commit

Permalink
Merge pull request #16188 from hrydgard/ridge-racer-sun-flare
Browse files Browse the repository at this point in the history
Fix depal bounds with dynamic CLUT. Fixes lens flare glitches in Ridge Racer
  • Loading branch information
hrydgard authored Oct 9, 2022
2 parents 28bc454 + 9422b05 commit f21fd36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GPU/Common/TextureCacheCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2242,10 +2242,11 @@ void TextureCacheCommon::ApplyTextureDepal(TexCacheEntry *entry) {
float u2 = texWidth;
float v2 = texHeight;
if (bounds.minV < bounds.maxV) {
u1 = (bounds.minU + gstate_c.curTextureXOffset) * texWidth;
v1 = (bounds.minV + gstate_c.curTextureYOffset) * texHeight;
u2 = (bounds.maxU + gstate_c.curTextureXOffset) * texWidth;
v2 = (bounds.maxV + gstate_c.curTextureYOffset) * texHeight;
// These are already in pixel coords! Doesn't seem like we should multiply by texwidth/height.
u1 = bounds.minU + gstate_c.curTextureXOffset;
v1 = bounds.minV + gstate_c.curTextureYOffset;
u2 = bounds.maxU + gstate_c.curTextureXOffset;
v2 = bounds.maxV + gstate_c.curTextureYOffset;
// We need to reapply the texture next time since we cropped UV.
gstate_c.Dirty(DIRTY_TEXTURE_PARAMS);
}
Expand Down

0 comments on commit f21fd36

Please sign in to comment.