softgpu: Avoid rect fast path with subpixel offset.

It doesn't handle it right, see #15876.  We still handle these with
DrawRectangle(), which gets it right.
This commit is contained in:
Unknown W. Brackets 2022-09-03 11:08:11 -07:00
parent 99681ff0f2
commit ba1ced4992

View file

@ -272,7 +272,9 @@ bool RectangleFastPath(const VertexData &v0, const VertexData &v1, BinManager &b
bool orient_check = xdiff >= 0 && ydiff >= 0;
// We already have a fast path for clear in ClearRectangle.
bool state_check = !state.pixelID.clearMode && !state.samplerID.hasAnyMips && NoClampOrWrap(state, v0.texturecoords) && NoClampOrWrap(state, v1.texturecoords);
if ((coord_check || !state.enableTextures) && orient_check && state_check) {
// This doesn't work well with offset drawing, see #15876. Through never has a subpixel offset.
bool subpixel_check = ((v0.screenpos.x | v0.screenpos.y | v1.screenpos.x | v1.screenpos.y) & 0xF) != 0;
if ((coord_check || !state.enableTextures) && orient_check && state_check && subpixel_check) {
binner.AddSprite(v0, v1);
return true;
}