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

With this wrong, we ended up drawing pixels that came from a DONT_CARE
init of the depal temp buffer, which was a pile of garbage on Android
and blank on PC.

Now, we seem to end up not drawing anything because the depal operation
results in transparent black into whatever is actually intended, but at
least the screen isn't full of glitches when the sun is visible on Adreno.

See issue #16083
This commit is contained in:
Henrik Rydgård committed 2022-10-09 20:27:45 +02:00
1 parent 28bc45451c
commit 9422b05ee3
1 file changed
+5 -4
+5 -4
View File
@@ -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);
}