Skip to content

Commit

Permalink
GS: Make sure min/max for texture is at least 1 pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jun 22, 2024
1 parent 6fc631e commit a132a6f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pcsx2/GS/GSState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit a132a6f

Please sign in to comment.