Repository navigation
Conversation
…#970) A console depth buffer that shaders write too has no ALLOW_UNORDERED_ACCESS on the PC (pc_resource_desc drops it) and its UAVs are null views, so the writes are lost. The title's barriers that use such a resource as a UAV are now counted and logged (the first 8, then every power of two): - transitions from or to UNORDERED_ACCESS and UAV barriers naming it, both for PC-format lists (resource_barrier_x) and console-recorded ones (console_list replay); - enhanced texture barriers (#146, D3D12_BARRIER_GROUP) with the UNORDERED_ACCESS layout or access. XCL still turns #146 into one global UAV barrier; only the description is read here. The null-view warning gives its total instead of stopping at 4. Measured on the retail title of xcl-dev#505 (RTX 5080, 300 s runs, A at 15 s): no legacy barrier touches these resources; enhanced barriers move D16 shadow maps (768x768x6, 1024x1024, 512x512) into or out of the UNORDERED_ACCESS layout once the world starts loading (62-64 s; 12 in a run with every one logged). No behaviour change: every barrier goes to the PC as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cl-dev#970) A console depth buffer that is also a UAV has no ALLOW_UNORDERED_ACCESS on the PC and its UAVs were null views: what the title's shaders wrote there was lost (the retail title of xcl-dev#505 moves its D16 shadow maps into the UNORDERED_ACCESS layout before it renders depth into them). With XCL_DEPTH_UAV_TWINS=1, such a depth buffer of one plane (R16 / R32 typeless) gets a twin: a texture of the same format and size with unordered access and no depth, kept as the depth buffer's private data. Its UAVs are views of the twin, and at the title's enhanced barriers (#146) into the UNORDERED_ACCESS layout the depth buffer is copied to the twin, at those out of it the twin back (in console-recorded lists the copies are recorded in the stream). XCL applies none of the title's enhanced barriers, so the copies' transitions start from the PC state the depth buffer was made in (kept at CreatePlacedResourceX; DEPTH_WRITE when not known). Depth and stencil formats keep null views: the PC has no UAV format for them. Off by default: without the variable nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#1063 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on xcl-dev#1027; only the top commit (
0322514) belongs here. Part of xcl-dev#970: the second step planned there, off by default.A console depth buffer that shaders write too has no
ALLOW_UNORDERED_ACCESSon the PC, and its UAVs were null views, so what the title's shaders wrote there was lost. WithXCL_DEPTH_UAV_TWINS=1, such a depth buffer of one plane (R16 / R32 typeless) gets a twin: a texture of the same format and size with unordered access and no depth, kept as the depth buffer's private data (released with it). Its UAVs are views of the twin, and at the title's enhanced barriers (#146) into theUNORDERED_ACCESSlayout the depth buffer is copied to the twin, at those out of it the twin back. Without the variable nothing changes.XCL applies none of the title's enhanced barriers, so on the PC such a depth buffer stays in the state it was made in: the copies' transitions start from that state (kept at
CreatePlacedResourceX, DEPTH_WRITE when not known). Depth + stencil formats keep null views: the PC has no UAV format for them.What is in it
crates/xcl/src/hle/d3d12x/depth_twin.rs(new):enabled,twin_desc,twin_for_uav/twin_of(private data),note_created/forget,twin_uav_desc(a typed view for a UAV made without a description),sync(transitions + CopyResource either way; no transition of the depth buffer when it is in the copy's state already). Tests:a_d16_or_d32_depth_buffer_gets_a_twin_with_unordered_access,a_depth_buffer_in_the_copys_state_is_not_moved_to_it,a_uav_without_a_description_is_a_typed_view_of_the_twin,a_released_depth_buffers_state_is_forgotten; GPU testgpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin(a D16 depth buffer's clear reaches the twin at the barrier into UAV, a write through the twin's UAV reaches the depth buffer at the barrier out of it; fails without the twin).crates/xcl/src/hle/d3d12x/real.rs:dev_create_uav_xmakes the view on the twin instead of a null view (typed when the title gave no description);res_releaseforgets the state of a released depth buffer.crates/xcl/src/hle/d3d12x/list_x.rs:note_depth_uav_barrier_groupsreturns the copies a [upstream #959] Tests: cover xcl shaders across files, folders, and RPF9 packs #146 call needs (twin_copy);uav_barrier_xruns them after its global UAV barrier. The barrier log says whether the UAVs are null views or views of the twin.crates/xcl/src/hle/d3d12x/console_list.rs: the same for console-recorded lists, recorded in the stream (TWIN_COPY_MARKER) and run at replay.crates/xcl/src/hle/d3d12x/device_x.rs:create_placed_resource_xkeeps the state such a depth buffer is made in.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at0322514withXCL_SAMPLE_RPF,_DLLS,_TTPF,_BVH4,_BK2,_AWCset: 720 passed, 3 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware. The 3 failures are the Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 flake (placed_title_textures_share_vram_and_preserve_pixels,cubemap extra_pages must be reused at same va, and the twoPoisonErrorfailures after it); the run before the review fixes (3ef1119) had 720 passed, 0 failed, and fourcargo test -p xcl --lib -- --test-threads=4runs failed on the flake 2 of 4 times on this branch and 2 of 4 times onmain09940bbon the same machine.scripts/smoke.ps1,XCL_PRESS_A_AT=15:XCL_DEPTH_UAV_TWINS=1at0322514: 256+ D16 shadow maps get twins at ~9 s (the 4 depth + stencil views stay null); the enhanced barriers into and out ofUNORDERED_ACCESSfrom ~66 s copied depth → twin and back 1024+ times; no device removal, the run ends by itself (exit 0x0, 1320 frames); peak commit 32058 MB (main's 60 s run: 27340 MB, its 300 s run: 30308 MB).XCL_DEPTH_UAV_TWINS=1at3ef1119(before the review fixes): the same twins and copies, no device removal, it ends in the title's "GPU Loc Sig" abort at 95.5 s asmaindoes.Regression run
main:
this PR:
Not tested
CreatePlacedResourceX(their copies assume DEPTH_WRITE)UNORDERED_ACCESS([upstream #1136] VFS: the Agility SDK's D3D12Core.dll stays on a console-mounted drive #26): counted by D3D12.X: count the barriers that use a depth buffer as a UAV (#970) xcl-dev/xcl#1027, not copied – the title of Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub xcl-dev/xcl#505 does not use them for these resourcesAI use
🤖 Generated with Claude Code
Mirror of xcl-dev#1063 (auto-synced, do not edit).