Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix depal bounds with dynamic CLUT. Fixes lens flare glitches in Ridge Racer #16188

Merged
merged 1 commit into from
Oct 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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