xg_x: calculate HTILE plane for single-mip depth-bind textures and write correct plane usages #123
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!123
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-123"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@adriaespii on GitHub · 2026-11-22 13:00 UTC · original
adriaespii:contrib/xg-x-htile-plane→main· +230 −26 · 3 files · 1 commits · openSummary
This PR implements HTILE plane calculation and correct plane usage serialization for depth-bind textures in \xg_x, resolving the depth buffer allocation size mismatch identified in \docs/BLOCKERS.md:244.
Context & Problem
In \docs/BLOCKERS.md:244:
Before this fix:
@omonkeyz on GitHub · 2026-11-22 13:23 UTC · original
Thanks for resubmitting #119 on the new main. A maintainer is checking it against the xg_x console oracle, since write_layout's plane count/usage change affects every planar layout. We'll follow up here with apply or the exact change needed. Note the gate also flags 3 comment lines in layout_oracle_tests.rs; please remove those.
@adriaespii on GitHub · 2026-11-22 15:15 UTC · original
@omonkeyz Thanks for the thorough oracle run and feedback! Rebased onto latest \upstream/main\ (incorporating #124) and addressed all points:
Ready for re-review whenever you have a chance!
@omonkeyz on GitHub · 2026-11-23 13:31 UTC · original
Review, changes needed: (1) it always uses the 128x64 rule for single slices, but that selector is not known yet (docs/BLOCKERS.md); please cite the source or measure it; (2) write_layout changes for every planar layout, which shifts the video-planar plane slots; (3) the oracle sweep panics through oracle().expect when the console DLLs are absent, so it must skip like the other fixture tests; (4) please give tests neutral names, not title names.
@omonkeyz on GitHub · 2026-11-25 13:51 UTC · original
Thanks. The head (
9f55c5d) is the same as at the last review, so the four points from 2026-11-23 still stand: the single-slice 128x64 vs 512x512 selector needs a source or a measurement, write_layout should not change plane slots for non-depth planar layouts, the oracle sweep must skip when the console DLLs are absent like the other fixture tests, and test names should be neutral. We will re-check once you push an update.@omonkeyz on GitHub · 2026-11-22 14:01 UTC · original · requested changes
Thanks! I checked this against the xg_x console oracle. Your Trackmania 1080p size (0x140c000) is right and its test passes, but 4 other oracle tests fail. Changes needed:
compute_with. Without the depth flag, the console writes 5 at 0x18 and 6 on the second plane for fmt 19/20/44/45. Use 7/8 only in the depth-bind path. Today this breaks texture2d_planar_zero_and_hw2_layouts_match_console, texture_computer_with_pitch_chains_and_planes_match_console and texture2d_depth_stencil_msaa_matches_console; each first differs at byte 0x18.is_depth_format: it accepts 39, 41, 53, 54 and 56 (typeless and colour formats) with the depth flag, and no oracle case checks them. The console reports size 0 for at least one colour format with the depth flag (fmt 60). Limit it to formats with oracle coverage (e.g. 40 and 55 plus the planar ones), or add oracle cases for the others.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.