mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1160] d3d12: Xbox device slots 70/71 write buffer views from a buffer description and its address (RT-TITLE-BUFFER-VIEWS) #1193
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#1193
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/1160
Author: @iFeyz
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:feat/title-buffer-views📝 Commits (2)
99176dad3d12: resolve views of live placed textures (RT-TITLE-TEXTURE-VIEWS)c4afec1RT-TITLE-BUFFER-VIEWS: Xbox device slots 70/71 write buffer views from a buffer description and its address📊 Changes
8 files changed (+453 additions, -113 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+14 -0)📝
runtime/CMakeLists.txt(+2 -0)📝
runtime/shims/d3d12_com_object.h(+4 -1)📝
runtime/shims/d3d12_vulkan_device.cpp(+201 -75)📝
runtime/shims/d3d12_xs_device.cpp(+46 -20)📝
runtime/shims/d3d12_xs_device.h(+8 -4)📝
runtime/test/d3d12_set0_compute_test.cpp(+163 -6)📝
runtime/test/xs_proxy_mock_test.cpp(+15 -7)📄 Description
Claimed in the coordination issue as: RT-TITLE-BUFFER-VIEWS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141517462)
Depends on: #1079 (this branch is built on it; its last commit is this pull request)
What and why
@DadaCap measured that Xbox device slots 70 (SRV) and 71 (UAV) also make buffer views, and that the missing ones are a cause of the world-phase GPU fault: with the null descriptor, the instance-culling dispatches read leftover memory as a V# and the device is lost (issue #14, comment 7140195321). #1079 resolves the texture half of the same two slots; this is the buffer half, on top of it.
runtime/shims/d3d12_xs_device.cpp: a buffer description now reaches the placed-view handler too, not onlyTEXTURE1D..3D.runtime/shims/d3d12_vulkan_device.cpp,write_placed_view: a buffer description writes the V# of a buffer view of the description'sWidthbytes at the address (dwords 10–11 of the view words). The address is taken as a GPU address, asCreateConstantBufferViewtakesBufferLocation. The V# is built by the same code asCreateShaderResourceView/CreateUnorderedAccessViewfor a buffer resource, factored out aswrite_buffer_srv_at/write_buffer_uav_at(address and size in, no resource object), so raw, structured and typed views and their bounds checks are the PC methods' and are not copied.0x20004) needs no masking: onlyALLOW_UNORDERED_ACCESS(0x4) is read.docs/d3d12_vulkan.md, next to #1079's paragraph on slots 70/71.Not measured here: whether the title's addresses for these buffers are ones the layer can read on every stack. They are used the way a CBV's address already is.
When stacked with DadaCap's
boot-prototype(or anything that addsarena_va()): the slot's address belongs to the same family as a CBV's or a vertex view's there, so translate it witharena_va()once inwrite_placed_viewbefore the two helpers are called. Takingwrite_buffer_srv_atwhole from this PR drops that call (DesertGamer's review, which re-ran with it kept).Retail result so far (DesertGamer, RTX 5070, with
arena_va()kept): the instance-culling device loss is still there at 83.4 s, so the null buffer views were at most one of its causes.Tested
d3d12_set0_compute_test(RX 9070 XT): through the real slot 70/71 entry points, with a buffer description carrying the retail flags0x20004, six views give exactly the descriptor the PC method writes for the same buffer: typedR32_UINT, structured stride 16 and 32 (UAVs); raw, structured, typed (SRVs). Three controls give the null descriptor: past the buffer's end, a counter offset, and a UAV of a description withoutALLOW_UNORDERED_ACCESS.99176da10):xs_proxy_mock*(6),d3d12_set0_compute,d3d12_placed_texture_uav_off: 8 of 8 pass,xs_proxy_mock_env_slots_invalidincluded now that #1079 routes its example away from slot 71.ctest303 of 308 pass. The 5 failures fail the same way without this commit:xs_proxy_mock_env_slots_invalidon #1079's previous head (passes on the current one, above), and the 4 already onmainhere (d3d12_clear,d3d12_execute_indirect_validation,d3d12_texture_tiles,d3d12_pipeline_library_host, reported in #14).tests/test_docs_links.py,scripts/check_no_game_data.pyon every changed file.GPUs tested: AMD Radeon RX 9070 XT, AMD Adrenalin 26.11.2 (Vulkan 1.4.359), Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.