Formats: reserve texture metadata memory in XG layouts #263
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!263
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/263/head"
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?
@Quat3rnion on GitHub · 2026-11-24 01:53 UTC · original
Quat3rnion:victory-texture-metadata→main· +137 −12 · 2 files · 1 commits · closed without mergingWhat
Render targets and depth buffers carry compression metadata (HTILE, CMASK,
DCC) on the console. The XG layout reported only the data planes, so a title
that sized a pool from it could run out of memory. This adds a conservative
metadata reservation after the data planes in the reported size and
alignment.
The exact metadata plane shapes depend on the GPU's pipe configuration and
their XG usage codes are not published. Rather than invent plane types that
a title might try to copy from, this reserves upper-bound memory (one eighth
of the data for depth, one sixteenth for color, rounded to 64 KiB) and leaves
the plane list and the host's data-plane layout unchanged. Sampled textures
get no reservation.
An AI tool wrote part of this change.
Tested
cargo test --workspacewith PR #112's Linux build fix applied locally (not part of this PR): 167 passed, 0 failed, 3 ignored. Three new tests cover sampled versus render targets, offset/overflow behaviour and the XG layout output.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. Windows-only tests were not run; there is no Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo fmton the changed hunks; workspace tests and Windows cross-check pass.cargo xtask policypasses. No game files or data from them were added.@jeremygold02 on GitHub · 2026-11-24 04:01 UTC · original
Tested the open PR at head
50d27a5a9237aaf00fee8090fc236e0358a90f2f(still current when refreshed before posting).cargo test --locked -p victory-formats metadata_— passedmetadata_reserves_room_only_for_render_targetsandmetadata_never_overlaps_or_overflows, covering sampled versus render-target reservations, 1D handling, alignment and overflow bounds in texture.rs.cargo test --locked -p victory-hle render_targets_reserve_metadata_memory— passedrender_targets_reserve_metadata_memory, exercising the XG layout response for color/depth size and alignment while checking data-plane count in xg.rs.These are synthetic unit tests; a real title or console GPU was not exercised.
@Marvisak on GitHub · 2026-11-25 00:01 UTC · original
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed