SoftGPU: Clip vertex texture coordinates in GE arithmetic

The near-plane clipper's new vertices get their texture coordinates with
the same float24 arithmetic as their position, not a float lerp. Fixes the
texel ties under a clipped fan in a GTA frame dump (gpu/probe exp136; clipped
colors and fog still differ).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-02 15:09:43 -06:00
1 parent b10ab1d4aa
commit 700a314542
1 file changed
+5
+5
View File
@@ -339,6 +339,11 @@ void ProcessTriangle(const ClipVertexData &v0, const ClipVertexData &v1, const C
const float t = TransformUnit::NearPlaneT(in.clippos, out.clippos);
dest.Lerp(t, in, out);
dest.clippos = TransformUnit::NearPlanePoint(in.clippos, out.clippos, t);
// Texture coordinates go through the same arithmetic as the position (gpu/probe exp136).
for (int c = 0; c < 3; ++c) {
const float delta = TruncateToFloat24(GEAdd(out.v.texturecoords[c], -in.v.texturecoords[c]));
dest.v.texturecoords[c] = TruncateToFloat24(GEAdd(ProductToFloat24((double)t * delta), in.v.texturecoords[c]));
}
bool outsideRange = false;
dest.v.screenpos = TransformUnit::ClipToScreen(dest.clippos, &outsideRange);
dest.v.clipw = dest.clippos.w;