mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1079] [CLOSED] d3d12: resolve views of live placed textures (RT-TITLE-TEXTURE-VIEWS) #1117
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1117
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1079
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/rt-title-texture-views📝 Commits (1)
0a92b13d3d12: resolve views of live placed textures (RT-TITLE-TEXTURE-VIEWS)📊 Changes
3 files changed (+95 additions, -6 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+5 -0)📝
runtime/CMakeLists.txt(+3 -0)📝
runtime/test/d3d12_set0_compute_test.cpp(+87 -6)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.