Skip to content

d3d12_vulkan.md: resources are CONCURRENT when dedicated queue families are in use - #5522

Open
Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/d3d12-queue-families-sharing
Open

Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/d3d12-queue-families-sharing

Conversation

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #5361.

Problem

docs/d3d12_vulkan.md:2272-2274 (at 3faac557) says resources are VK_SHARING_MODE_EXCLUSIVE and every D3D12 queue is in the graphics family, and that dedicated compute/transfer families "would need CONCURRENT". The same doc's queue row (:1699) and the code say otherwise:

  • compute and copy queues use dedicated families when the GPU has them (runtime/src/queue_families.h, selected in runtime/shims/d3d12_vulkan_device.cpp around :8223), else graphics-family leases;
  • with more than one family in use, buffers, images, the arena and staging are created VK_SHARING_MODE_CONCURRENT (:477);
  • runtime/test/vk_queue_test.cpp checks distinct families.

Change

Doc only: the stale sentence now says resources are CONCURRENT over the families in use when there is more than one, else EXCLUSIVE, and that no ownership transfer is needed either way.

Tested

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

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

…es are in use

Section 4.x still said every D3D12 queue is in the graphics family and resources are EXCLUSIVE.
Compute/copy queues use dedicated families when the GPU has them (queue_families.h), and buffers,
images, the arena and staging are then created CONCURRENT over those families, as section 4
already documents.
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

AI-assisted review of e351910. The sharing rule is correct for the families the runtime selects. Please change “dedicated compute/copy families when the GPU has them” to “dedicated compute or copy families when the runtime selects them.”

The test at runtime/test/vk_queue_test.cpp:68 supplies three families. Family 0 supports graphics and sparse binding. The dedicated copy and compute families lack sparse binding. With sparse buffers enabled, the runtime selects family 0 for all three queues. With sparse buffers disabled, it selects families 0, 2, and 1. The same family list produces both results. The production device applies this selection at runtime/shims/d3d12_vulkan_device.cpp:8231.

I built vk_queue_test and ran it on Windows 11. All seven synthetic layouts passed. The RTX 4090 reported direct/compute/copy families 0/2/1. The AMD Radeon iGPU reported 0/1/1. Both adapters passed the buffer and texture readback checks.

@lines9686-rgb

Copy link
Copy Markdown
Contributor

Heads-up @Pierre-Kookis: this sentence (d3d12_vulkan.md:2272-2274, EXCLUSIVE / graphics family only) is item 8 of the finding claimed in #5361 at 10:50 (#5361 (comment)), and #5422 (opened 10:55) already rewrites it to the CONCURRENT wording, together with the "dedicated compute/transfer families ... remain future work" sentence near line 529. The two branches conflict on those lines, so only one of them can merge as is. Happy to take any wording from yours into #5422 if you prefer it. AI-assisted (Claude Code).

…(review)

With sparse binding enabled the runtime can keep compute/copy on the graphics family even when
the GPU has dedicated ones (d3d12_vulkan_device.cpp ~8231), so say 'when the runtime selects them'.
@Pierre-Kookis

Copy link
Copy Markdown
Contributor Author

@shdann thanks, agreed: with sparse binding the runtime keeps compute/copy on the graphics family even when the GPU has dedicated ones (d3d12_vulkan_device.cpp:8231). Pushed your wording: "dedicated compute or copy families when the runtime selects them". test_docs*.py: OK.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review at head 2f5f316ca (docs only).

Verified against the code at 3faac557b:

  • runtime/src/queue_families.h exists; pick_queue_families picks a compute family without graphics and a DMA copy family with 1x1x1 granularity.
  • d3d12_vulkan_device.cpp:8223 selects it, and :8232-8251 creates the extra family queues.
  • DeviceState::share() (:469-480) sets VK_SHARING_MODE_CONCURRENT over families when there is more than one, else leaves EXCLUSIVE; it is called from the buffer, image, arena and staging create sites (:1677, :1830, :2127, :4538).
  • The doc's own queue row (docs/d3d12_vulkan.md:1699) already said this, so the edited paragraph now agrees with it. "section 4" resolves to ## 4. Object model mapping.

Commands: python -I -m pytest tests/test_docs_*.py -q → 19 passed, 6 subtests. git diff --check clean.

Verdict: approve.

lines9686-rgb added a commit to lines9686-rgb/Leonida that referenced this pull request Nov 23, 2026
…ts them (sparse binding)

With sparse buffers, a dedicated compute or transfer family without VK_QUEUE_SPARSE_BINDING_BIT is passed over
for the graphics family (sparse_capable_queue_families). Pointed out by @Pierre-Kookis and @shdann on ItsNotRexed#5522.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

4 participants