Skip to content

Fix GX texture minification decoding and signed LOD bias encoding - #293

Merged
encounter merged 2 commits into
encounter:mainfrom
AttilaTheFun:melee-upstream-contributions
Oct 20, 2026
Merged

encounter merged 2 commits into
encounter:mainfrom
AttilaTheFun:melee-upstream-contributions

Conversation

@AttilaTheFun

@AttilaTheFun AttilaTheFun commented Oct 17, 2026 •

Copy link
Copy Markdown

Two small texture fixes from our Melee port:

  • GX_LIN_MIP_NEAR and GX_NEAR_MIP_LIN were swapped when decoding the hardware filter bits.
  • Negative LOD bias needs a signed integer conversion before converting to u8; the direct float-to-byte cast is undefined.

Added round-trip tests for both. They reproduce the issues on main, and all 232 gx_fifo_tests pass with the fixes on macOS arm64, with float-cast-overflow UBSan enabled.

@AttilaTheFun
AttilaTheFun marked this pull request as ready for review October 17, 2026 21:48
@encounter

Copy link
Copy Markdown
Owner

Appears to be correct, thanks!

@encounter
encounter merged commit 26371ce into encounter:main Oct 20, 2026
6 checks passed
magcius pushed a commit to TwilitRealm/aurora that referenced this pull request Oct 27, 2026
…counter#293)

* Fix GX texture minification decoding and signed LOD bias encoding

* Remove explanatory comments from texture fixes
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.

2 participants