GS: Make sure min/max for texture is at least 1 pixel

This commit is contained in:
refractionpcsx2 2024-06-22 22:14:20 +01:00
parent 6fc631eaba
commit a132a6f979
1 changed files with 11 additions and 1 deletions

View File

@ -4003,7 +4003,17 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL
const bool inc_x = vr.x < tr.z;
const bool inc_y = vr.y < tr.w;
vr = (vr + GSVector4i(inc_x ? 0 : -1, inc_y ? 0 : -1, inc_x ? 1 : 0, inc_y ? 1 : 0).xxyy()).rintersect(tr);
vr = (vr + GSVector4i(inc_x ? 0 : -1, inc_y ? 0 : -1, inc_x ? 1 : 0, inc_y ? 1 : 0)).rintersect(tr);
}
else if (vr.xzxz().rempty())
{
const bool inc_x = vr.x < tr.z;
vr = (vr + GSVector4i(inc_x ? 0 : -1, 0, inc_x ? 1 : 0, 0)).rintersect(tr);
}
else if (vr.ywyw().rempty())
{
const bool inc_y = vr.y < tr.w;
vr = (vr + GSVector4i(0, inc_y ? 0 : -1, 0, inc_y ? 1 : 0)).rintersect(tr);
}
return { vr, uses_border };