XG accepts the depth swizzle for Xbox D16_UNORM_S8_UINT #4266
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4266
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4265"
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?
@RanoGames on GitHub · 2026-11-30 17:57 UTC · original
RanoGames:fix/xg-d16s8-swizzle-validation→main· +18 −3 · 1 files · 1 commits · openWhat it changes
A title using
D16_UNORM_S8_UINTcan ask XG for its depth-stencil swizzle mode, pass the answer straight to the validator, and receiveE_INVALIDARG. Xbox uses format 118 for this 16-bit depth plus 8-bit stencil resource.Recognise 118 as a depth resource in
XGValidateDepthStencilSwizzleMode. Formats 119 and 120 are the corresponding shader views. Microsoft DirectXTex format definitionsHow it was tested
CPU-only Windows regression through
XGComputeOptimalDepthStencilSwizzleModeandXGValidateDepthStencilSwizzleModeusing a synthetic 640×480 surface.Before the fix the picker returned
SW_64KB_Z_Xand the validator rejected it for format 118.After the fix the validator accepts that mode for 1, 2, 4 and 8 samples and returns
E_INVALIDARGfor both shader views.cargo test --locked -p victory-hle -- --test-threads=1passed (470 unit tests, 2 integration tests, 13 ignored). An XMem timing assertion failed in the first parallel run and passed in isolation.The PR CI run stopped at the same three Clippy diagnostics as the base commit's CI run.
Checked for overlap
@babuakhil on GitHub · 2026-11-30 19:23 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), applied on current
main(e1251c31); cherry-picks cleanly.cargo test -p victory-hle --lib modules::xg::gives 16 passed, 0 failed. With only the118taken back out ofis_depth_format, the new test fails as described (XGValidateDepthStencilSwizzleMode(118, …)returns0x80070057where it expectsS_OK), so it pins the fix. Not tested in the game.The format numbers agree with the rest of the tree:
victory_formats::texture::formatalready has118..=120 => (2, 1, true), a 2-byte depth with stencil in its own plane, the same family shape as19..=22and44..=47. Accepting the depth resource (118) and refusing its two shader views (119, 120) matches what the validator already does for those families (19/20 and 44/45 accepted, 21/22 and 46/47 not).002442a0a6to1da0fedfa0View 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.