Skip to content

Lowering: SULD.P on a 1D surface (17 compute programs translate again) - #1447

Merged
NotRexed merged 4 commits into
NotRexed:mainfrom
Joey-Magnus:fix/suld-formatted
Nov 10, 2026
Merged

NotRexed merged 4 commits into
NotRexed:mainfrom
Joey-Magnus:fix/suld-formatted

Conversation

@Joey-Magnus

Copy link
Copy Markdown
Contributor

What

SULD.P with dimension code 0 (1D) stopped the Ampere -> Maxwell lowering as "native formatted surface load mode", because the lowering accepted only 2D, 2D_ARRAY and 3D. Seventeen of OoT's compute programs stopped there (00007b97 00001000 001e0100 000f6200 and 01007b97 00000800 001e0100 000f6200), and a program that does not lower never runs.

1D is Maxwell SULD.P.1D with one coordinate register. The Maxwell frontend already reads it as a Color1D image (surface_load_store.cpp), and the back end binds VK_IMAGE_VIEW_TYPE_1D (vk_draw.cpp view_type). So the change only lets code 0 through and allows a coordinate register up to R254. 1D_BUFFER and 1D_ARRAY (codes 1 and 2) are not seen in the game and stay refused.

Tested

--prepare-shaders on the full shader list (Linux, RTX 4070 Ti, fresh caches):

programs that do not lower
main 83
this PR 66 (all 17 "formatted surface load" gone, no new compile errors)
this PR + #1437 (measured on a local merge) 26
  • In game: the Water Temple save loads and draws with this hookshot_vk.so, with no device loss or crash.
  • tests/test_lower_suld_1d.py (new, registered in run_all.py) covers both encodings from the log, a 2D load (unchanged) and the refused 1D_BUFFER/1D_ARRAY codes. It fails without this change. The full tests/run_all.py passes: 190 passed, 19 skipped.

Note: #1437 adds its test line at the same place in tests/run_all.py. Whichever merges second needs a one-line conflict resolved, and I'll rebase it.

🤖 Generated with Claude Code

SULD.P with dimension code 0 (1D) stopped the Ampere -> Maxwell lowering
as "native formatted surface load mode": only 2D, 2D_ARRAY and 3D were
taken. 1D is Maxwell SULD.P.1D with one coordinate register; the Maxwell
frontend already reads it as a Color1D image and the back end binds
VK_IMAGE_VIEW_TYPE_1D. 1D_BUFFER and 1D_ARRAY (codes 1 and 2) are not
seen in the game and stay refused.

--prepare-shaders on the full shader list: 83 -> 66 programs that do not
lower (all 17 "formatted surface load" gone, no new compile errors; with
NotRexed#1437 too it is 43 -> 26). In game (Water Temple) nothing changes for
the worse. tests/test_lower_suld_1d.py: both encodings from the log, 2D
as before, 1D_BUFFER/1D_ARRAY refused; it fails without this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate bound (review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joey-Magnus

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Nits addressed in the latest commit on this branch (tests pass locally).

@NotRexed
NotRexed merged commit 88b554e into NotRexed:main Nov 10, 2026
10 checks passed
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