Skip to content

d3d12_vulkan.md: WriteBufferImmediate works now that buffers have GPU virtual addresses - #5456

Closed
Pierre-Kookis wants to merge 1 commit into
ProjectLeonida:mainfrom
Pierre-Kookis:docs/write-buffer-immediate-va
Closed

Pierre-Kookis wants to merge 1 commit into
ProjectLeonida:mainfrom
Pierre-Kookis:docs/write-buffer-immediate-va

Conversation

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #5361.

Problem

Two passages of docs/d3d12_vulkan.md (at 3faac557) still say an immediate write is refused because no buffer has a GPU virtual address yet:

The same doc says at :1224 that the device returns VAs from GetGPUVirtualAddress, and runtime/test/d3d12_vulkan_device_test.cpp:6975-6990 replays an immediate write into a placed buffer and reads 0xCAFEBABE back. Only a write to an address no buffer covers (0x10000, :6110-6119) is refused as unresolved_resource.

Change

Doc only: both passages say that. (The test's comment at :6110-6111 repeats the old reason; I left the test file untouched.)

Tested

python -I -m unittest discover -s tests -p "test_docs*.py": OK.

AI-assisted (Claude Code + Codex; checked against the test). No game files.

… virtual addresses

Two passages still said an immediate write is refused because no buffer has a GPU VA yet. The
device returns VAs from GetGPUVirtualAddress, and d3d12_vulkan_device_test replays an immediate
write into a placed buffer and reads it back; only a write to an address no buffer covers is refused
as unresolved_resource.
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested ad9a0b8 on Windows 11 with NVIDIA GeForce RTX 4090 (32.0.16.2101) and AMD Radeon Graphics (32.0.21043.5001): pass.

Both revised passages match the runtime. On each GPU, an immediate write to the unmapped address 0x10000 returned unresolved_resource at execution. A write to the placed buffer at offset 16 succeeded. After the fence completed, the readback contained 0xCAFEBABE. I added temporary prints at the assertions to confirm that both cases ran on each adapter.

I built with cmake --build E:/Leonida-review-work-build --config RelWithDebInfo --target d3d12_vulkan_device_test and ran d3d12_vulkan_device_test.exe with LEONIDA_VK_VALIDATION=1 and LEONIDA_VK_DEVICE set to each adapter. Both runs exited 0. All 30 documentation tests passed with py -3.14 -I -m unittest discover -s tests -p "test_docs*.py". The PR changes documentation only.

AI-assisted. Synthetic inputs only.

@LAKSHYA-cmd-tech LAKSHYA-cmd-tech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ad9a0b81 on Windows 11, CPython 3.12 (CPU only, no game files): pass.

  • Verified against runtime/test/d3d12_vulkan_device_test.cpp:6970-6992: WriteBufferImmediate into placed buffers with GPU virtual addresses succeeds and reads back 0xCAFEBABE, matching the doc update at lines 901 and 2082–2084 of docs/d3d12_vulkan.md.
  • Verified against runtime/test/d3d12_vulkan_device_test.cpp:6110-6120: writing to unmapped virtual address 0x10000 is refused with ReplayResult::unresolved_resource, as documented.
  • Ran all documentation tests: python -I -m unittest discover -s tests -p "test_docs*.py" (30/30 passed in 14.0s).

Approved. AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head ad9a0b815c7e · Verdict: LGTM

Docs-only; git diff --check clean; docs tests 5 passed (test_docs_cli_flags, test_docs_repo_paths).

Verified both changed claims on this head: WriteBufferImmediate to an uncovered VA returns unresolved_resource (d3d12_vulkan_device_test 6114-6118), and a write to a placed buffer is replayed and read back (6973-6985, word == 0xCAFEBABE). No blockers.

Raxstreams added a commit to Raxstreams/Leonida that referenced this pull request Nov 23, 2026
d3d12_vulkan.md: WriteBufferImmediate works now that buffers have GPU virtual addresses

Independent review: ProjectLeonida#5456 (comment)

Fork integration. AI-assisted (Codex).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants