D3D12.X: a title's TEXTURECUBE view is the cube array of its one cube #149
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!149
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/149/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?
@cortexreaver2099-creator on GitHub · 2026-11-23 16:17 UTC · original
cortexreaver2099-creator:srv-cube-as-cube-array→main· +59 −0 · 1 files · 1 commits · merged 2026-11-23 21:08 UTCFollow-up to the risk @Foniass noted on #117 (#105 item 2).
Since #117, translated shaders declare every cube T# as a
TextureCubeArray. Butdev_create_srv_x(hle/d3d12x/real.rs) still forwarded a title's own SRV description unchanged. So a title that makes aD3D12_SRV_DIMENSION_TEXTURECUBEview had it bound to a shader declaring a cube array, a dimension mismatch that D3D12 leaves undefined.This is the cheap guard suggested there. Before the view is forwarded, a
TEXTURECUBEdescription is rewritten into:TEXTURECUBEARRAYand every other dimension are forwarded unchanged.dev_create_srv_at_x, views of memory) callsdev_create_srv_x, so it gets the same rewrite.view_shapealready maps dimensions 9 and 10 toImageType::Cubewith 6 layers for one cube.Test:
srv_tests::a_cube_view_becomes_the_cube_array_of_one_cubecovers the rewrite: mips, clamp, format and mapping are kept, and cube arrays and other dimensions are left alone.This test doesn't prove the mismatch was harmful. As Foniass found, a plain
TEXTURECUBESRV sampled correctly on NVIDIA. A GPU test can't fail reliably on undefined behaviour, and the debug layer (d3d12SDKLayers.dll, from the Windows "Graphics Tools" feature) isn't installed on this machine, so I couldn't confirm the validation message goes away. AMD hasn't been checked.Tested on an NVIDIA RTX 3090 (32-lane waves, driver 32.0.16.1714), Windows 11 26200, DXC from SDK 10.0.26100. I ran
cargo test --workspace --no-fail-fastwithout the retail samples:gpu_cube_array_slicespasses. The only 2 skips are by design (no wave64):gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.console_dlls_e2e,console_shaders,disasm_e2e,gpu_compute_e2e,gpu_pso_e2e,rpf_e2e,xg_oracle: all pass.e2e::test_title_runs_and_game_folder_is_untouchedfails onmaintoo. This PC has noSystem32\xgameruntime.dll, and the test treats the launcher's resultingWARNINGas a failure, the same reason #143 skips it on CI. The test title's 50 checks all print[PASS].🤖 Generated with Claude Code
@ivall on GitHub · 2026-11-23 21:09 UTC · original
Merged (main
6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on maineaa36b6:cargo build --workspace && cargo test --workspace -- --test-threads=4- 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).