Skip to content

Preserve GS sprite endpoint alignment and fractional coordinates - #281

Open
Fiztba wants to merge 1 commit into
ran-j:mainfrom
Fiztba:fix/gs-sprite-coordinate-alignment
Open

Fiztba wants to merge 1 commit into
ran-j:mainfrom
Fiztba:fix/gs-sprite-coordinate-alignment

Conversation

@Fiztba

@Fiztba Fiztba commented Oct 10, 2026

Copy link
Copy Markdown

King's Field IV draws its framebuffer feedback effect in adjacent 64-pixel sprites, often supplying the corners in reverse order. Sorting XY without sorting the corresponding UV mirrors each strip and produces visible brightness and texture seams. Truncating fractional coordinates and sampling at half-pixel positions also misaligns sprite coverage and interpolation.

Keep each screen endpoint paired with its texture endpoint per axis, preserve fractional XYOFFSET/UV, use ceil-exclusive coverage and integer GS sample positions, and use the second vertex's flat Q. Interpolated UV reaches the floating sampler without another four-bit quantization. Texture-cache policy and depth handling are unchanged.

Validation:

  • Native Windows x64 MSVC 19.44, RelWithDebInfo, /O2 /fp:strict: all 47 standalone GS cache/sprite CTest entries pass.
  • Independent coordinate and identity-feedback oracles pass 853,552 checks. Four reversed 64-pixel feedback strips change zero pixels and introduce zero boundary steps.
  • The same fixture against the unchanged main-branch backend fails 46,839 checks, changes 7,812 feedback pixels, and introduces 217 boundary steps. The fixture explicitly enables ZTE/ALWAYS and masks depth writes to isolate this fix from Honor disabled GS depth testing and restore movie pixels #280.
  • Pinned primary PCSX2 references and test boundaries are documented in ps2xTest/gs_cache/README.md. The public backend is synchronous; no asynchronous-worker or Linux validation is claimed.

No disc assets, generated game code, game screenshots, executables, saves or traces are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant