GS: Fix TextureMinMax when coordinates are completely outside of min/max

This commit is contained in:
TellowKrinkle 2022-05-05 22:22:02 -05:00 committed by refractionpcsx2
parent 3f027b2698
commit 3a97688804
1 changed files with 4 additions and 4 deletions

View File

@ -3275,9 +3275,9 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(const GIFRegTEX0& TEX0, c
case CLAMP_CLAMP:
case CLAMP_REGION_CLAMP:
if (vr.x < uv.x)
vr.x = uv.x;
vr.x = std::min(uv.x, vr.z - 1);
if (vr.z > (uv.z + 1))
vr.z = uv.z + 1;
vr.z = std::max(uv.z, vr.x) + 1;
break;
case CLAMP_REGION_REPEAT:
if (UsesRegionRepeat(maxu, minu, uv.x, uv.z, &vr.x, &vr.z) || maxu >= tw)
@ -3297,9 +3297,9 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(const GIFRegTEX0& TEX0, c
case CLAMP_CLAMP:
case CLAMP_REGION_CLAMP:
if (vr.y < uv.y)
vr.y = uv.y;
vr.y = std::min(uv.y, vr.w - 1);
if (vr.w > (uv.w + 1))
vr.w = uv.w + 1;
vr.w = std::max(uv.w, vr.y) + 1;
break;
case CLAMP_REGION_REPEAT:
if (UsesRegionRepeat(maxv, minv, uv.y, uv.w, &vr.y, &vr.w) || maxv >= th)