d3d12: resolve views of live placed textures (RT-TITLE-TEXTURE-VIEWS) #1079
Closed
leonida/mandy
Moriz82 wants to merge 0 commits from
split/rt-title-texture-views into main
pull from: split/rt-title-texture-views
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!1079
Loading…
Reference in a new issue
No description provided.
Delete branch "split/rt-title-texture-views"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Rebased diff at
0a92b139. Main already has the placed-texture SRV and UAV paths. This PR keeps regression coverage for choosing the right live array placement when two textures share an address, rejecting a view after that placement is released, and accepting a complete 3D mip while rejecting a partial view. CTest also runs the same fixture withLEONIDA_PLACED_TEXTURE_UAV=0. The test results below apply to earlier heads.Claimed in the coordination issue as: RT-TITLE-TEXTURE-VIEWS (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #356 supplied the null SRV fallback for Xbox device slot 70. This child retains that fallback for missing images. #461 concerns CPU texture layout. The live-image path uses the Vulkan image already created by slot 133.
What and why
A shader-resource view of an existing GPU texture returned a null descriptor when the caller supplied the texture's placement address. The equivalent unordered-access call could reach an unrelated PC device method.
Slots 70 and 71 now resolve a live slot-133 texture by address, shape and format. When several images share an address, the most recent compatible image wins. The lookup holds a reference while writing the descriptor. Final release removes only that resource from the index. A UAV requires writable backing. A 3D UAV must span a complete mip. Unmatched views produce null descriptors. Set
LEONIDA_PLACED_TEXTURE_UAV=0to return null placed UAVs for comparison.CPU-source uploads and refresh belong to the separate RT-TITLE-TEXTURE-SOURCES topic.
Tested
Linux/Proton Experimental (Wine 11), GeForce RTX 4070 12 GB, NVIDIA 620.73.04. Release cross-build with clang-cl 23 and an xwin SDK. Each command below used the same configured build directory.
PROTON_WINEnames the Wine executable andWINEPREFIXselects the test prefix.All three targets built. The default and rollback runs each sampled all 64 expected texels through the placed SRV. Each also checked an ordinary SRV, a clamping sampler and a missing-descriptor fallback, for 256 texel checks per run. The default produced two valid UAVs (an array layer and a complete volume mip) and two null controls (released placement and partial mip). The rollback produced four null UAVs. The plain-device proxy test passed at both emulated device interface levels and checked both slots with and without destinations. The six ways CTest runs it (plain, three refused allocations, and the two environment-slot cases) all exit zero.
Fixed after the first version.
xs_proxy_mock --env-slots-invalidfailed on the first head. It used device slot 71 as its example of a PC slot that is forwarded unchanged, and this change routes slot 71 to the placed texture UAV. The first version ran only the plain form of the test, so it missed that. The case now probes slot 72 and asserts that it is not overridden. Reported by Plaaasma on native Windows and reproduced by madhyn on Wine; reproduced here before the fix (exit 1 at that line) and passing after it.Rebased onto
main9f25f1ef2. #375 (XMem hooks and console render-target sizes) changed the same two places as this change. Indevice_slot_overridden(runtime/shims/d3d12_xs_device.cpp) it adds slots 17 to 24 and 56 and this change adds slot 71; in the list of checks ofruntime/test/xs_proxy_mock_test.cppit adds five checks and this change renamescheck_slot70tocheck_placed_views. Both sides are kept, and nothing else conflicted. Slot 72, which the invalid environment-slot case probes, is still not routed. On the rebased head the three targets were rebuilt and all eight registered forms were run again:d3d12_set0_compute,d3d12_placed_texture_uav_off(LEONIDA_PLACED_TEXTURE_UAV=0) and the sixxs_proxy_mockforms. These runs used Wine 11.22 (distribution package, a prefix of its own) instead of Proton Experimental, on the same GPU and driver. All exit 0 with the results described above (2 matching UAVs and 2 null controls by default, 4 null controls in the rollback, 64 texels per sampled view), and the plainxs_proxy_mockrun includes the five checks #375 added.GPUs tested: NVIDIA GeForce RTX 4070. Native Windows, AMD, Intel and a game boot were not tested on this child by us; the reviewers' native Windows and Wine runs were on the first head. The cross-build omitted the optional XMA decoder because the Rust Windows target was unavailable.
AI-assisted: yes.
Checklist
3aa975421. Merges cleanly.scripts/check_no_game_data.py.🤖 Generated with Claude Code
Native Windows check, AI-assisted (Claude Code). Windows 11, i9-13900K, 64 GB, RTX 4070 Ti 12 GB (NVIDIA 630.20), MSVC 2022 (VS 17 generator, Release), Vulkan.
Head
0ffeeed0e. Builtxs_proxy_mock_test d3d12_set0_compute_test, thenctest -C Release -R "^(xs_proxy_mock.*|d3d12_set0_compute|d3d12_placed_texture_uav_off)$" --output-on-failure --timeout 300:xs_proxy_mock,_no_reserve,_no_protect,_no_handler,_env_slots: passed (0.02 s each)d3d12_set0_compute: passed, 0.72 sd3d12_placed_texture_uav_off: passed, 0.66 sxs_proxy_mock_env_slots_invalid: FAILED, atxs_proxy_mock line 1073: hr_of(raw(device, 71)) == S_OK && mock->calls[71] == 17 passed, 1 failed. The same test passes on current
main(71f99e224), so it looks like the--env-slots-invalidbranch still expects slot 71 to be forwarded as "not an Xbox slot", while this PR now overrides 71.Reviewed and verified. Robust resolution of live slot-133 placed textures by address, format, and dimensions for Xbox device slots 70 (SRV) and 71 (UAV). Cleanly manages lifetime via TexturePlacements multimap under placement_mutex, returning null descriptors for unmatched placements or released resources. Includes LEONIDA_PLACED_TEXTURE_UAV=0 rollback and comprehensive tests in d3d12_set0_compute_test and xs_proxy_mock_test. 100% clean-room.
Independently reproduced on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (
0ffeeed0e, clang-cl + xwin cross-build):ctest --test-dir runtime/build/win -R "^(xs_proxy_mock.*|d3d12_set0_compute|d3d12_placed_texture_uav_off)$" --output-on-failure:xs_proxy_mock,_no_reserve,_no_protect,_no_handler,_env_slots: Passedd3d12_set0_compute: Passed (5.49 s)d3d12_placed_texture_uav_off: Passed (5.45 s)xs_proxy_mock_env_slots_invalid: Failed (5.32 s) — same failure as reported above:[rt] d3d12_xs: device slot 71 routed to placed texture UAVxs_proxy_mock line 1073: hr_of(raw(device, 71)) == S_OK && mock->calls[71] == 17 passed, 1 failed (88%).
AI-assisted: yes
@Plaaasma @madhyn thank you, you were both right, and the diagnosis in the first report was exact.
xs_proxy_mock --env-slots-invalidused device slot 71 as its example of a PC slot that is forwarded unchanged, and this pull request routes slot 71 to the placed texture UAV. I had run only the plain form of the test, not the six ways CTest runs it, so I missed it.The branch is updated. The case now probes slot 72 and asserts that slot 72 is not overridden, which is what the integration branch (#984) already does.
Run here on the new head (CachyOS, Proton Experimental, clang-cl + xwin, RTX 4070, NVIDIA 620.73.04): before the fix
--env-slots-invalidexits 1 at that line; after it, all six forms ofxs_proxy_mock_testexit 0 (plain,--fail-virtualalloc,--fail-virtualprotect,--fail-veh,--env-slots,--env-slots-invalid), andd3d12_set0_compute_testexits 0 with and withoutLEONIDA_PLACED_TEXTURE_UAV=0(2 matching UAVs and 2 null controls by default, 4 null controls with the switch). Native Windows is not run here; if either of you reruns the samectest -Rline on this head, that closes it.🤖 Generated with Claude Code
AMD run (the gap the description lists): RX 9070 XT (RDNA4, GFX1201), AMD proprietary Windows driver 26.11.2 (LLPC, Vulkan 1.4.359), Windows 11, MSVC 2022 RelWithDebInfo.
Head
99176da10(the one with thexs_proxy_mockfix):xs_proxy_mock,_no_reserve,_no_protect,_no_handler,_env_slots,_env_slots_invalidandd3d12_set0_compute: 7 of 7 pass. The slot-71 failure of the previous head is gone here.Ran this on Linux under Wine and Proton, as part of VERIFY-WINE-PROTON-GPU in #14. Your branch at 99176da10, merged into main at 58be9cdf8 (the merge is clean).
d3d12_set0_computeline 104: got == (enabled ? expected : Words{}),line 249: check_placed_uavs(device.p) == 0d3d12_placed_texture_uav_offline 108: got == Words{},line 249xs_proxy_mockline 1174: device_slot_overridden(70) && device_slot_overridden(71)xs_proxy_mock_no_reserve,_no_protect,_no_handler,_env_slots,_env_slots_invalidThe same results on each host: WineHQ 11.22 (winewayland) and GE-Proton11-14 (winex11, with
d3d12,d3d12coreanddxgiset to native) on an RTX 3090 (NVIDIA 590.48.01), and GE-Proton on the Radeon iGPU of a Ryzen 5 7600 (RADV, Mesa 26.0.8) for the twod3d12_set0_computeregistrations. So the new checks fail on main's code and pass with your change.These tests are Windows-only, so nothing ran natively. Built with clang-cl and xwin in a container; not run on Windows or with the retail game.
AI-assisted (Claude).
Rebased onto
main9f25f1ef2: the branch had started to conflict after #375 merged. #375 and this change both editdevice_slot_overriddeninruntime/shims/d3d12_xs_device.cpp(#375 adds slots 17 to 24 and 56, this change adds slot 71) and the list of checks inruntime/test/xs_proxy_mock_test.cpp(#375 adds five, this change renamescheck_slot70tocheck_placed_views). Both sides are kept; nothing else changed.On the new head the three targets were rebuilt and all eight registered forms run again on an RTX 4070 (NVIDIA 620.73.04), this time under Wine 11.22 (distribution package):
d3d12_set0_compute,d3d12_placed_texture_uav_offand the sixxs_proxy_mockforms all exit 0, with the same results as before. The plainxs_proxy_mockrun includes the checks #375 added. The description has a paragraph on this.AI-assisted (Claude Code).
🤖 Generated with Claude Code