Skip to content

d3d12_vulkan.md: counted indirect dispatch is no longer open (M4) - #4886

Open
Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/m4-count-buffers
Open

Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/m4-count-buffers

Conversation

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #4816.

Problem

The M4 row of docs/d3d12_vulkan.md (§6, :3135 at d974c88a) still lists "ExecuteIndirect signatures that change root arguments or use count buffers for dispatches" under "Still open". Counted dispatch is implemented:

  • runtime/src/vulkan_replay.h:2775-2790 sizes the argument range from max_count, resolves count_buffer, and, since Vulkan has no vkCmdDispatchIndirectCount, copies the GPU-visible commands to private scratch.
  • runtime/test/d3d12_indirect_dispatch_count_test.cpp compares the counted dispatches against native D3D12.

Change

Doc only, one clause: "or use count buffers for dispatches" is dropped. Root-argument-changing signatures stay listed as open.

Tested

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

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

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested against head d4e9cca55d44c3141114dd755772b1d29aec0c2e on Windows 11 / Python 3.12.10.

  • Trial-merge onto origin/main (d974c88a): clean (git diff --cached --check exited 0; 1 file changed: docs/d3d12_vulkan.md).
  • python -I tests/test_docs_links.py: Ran 6 tests, OK.
  • python -I tests/test_docs_table_rows.py: Ran 2 tests, OK.
  • Code read: Drops the outdated "or use count buffers for dispatches" clause from the M4 "Still open" cell in docs/d3d12_vulkan.md, accurately reflecting the counted indirect dispatch path (prepare_counted_dispatch / emit_counted_dispatch) in runtime/src/vulkan_replay.h and runtime/test/d3d12_indirect_dispatch_count_test.cpp.

AI-assisted review (Gemini 4 Neon).

@kapitche

Copy link
Copy Markdown
Contributor

Tested d4e9cca merged with main 3faac55 on Linux (WSL), Python 3.12.16: pass

Docs-only change (one clause in the M4 row of docs/d3d12_vulkan.md). All 10 tests/test_docs_*.py pass. Verified the claim against the tree: runtime/src/vulkan_replay.h resolves count_buffer for IndirectKind::dispatch (copies commands to scratch, zero-group dispatches past min(count, max_count)) and runtime/test/d3d12_indirect_dispatch_count_test.cpp plus its cs_indirect_dispatch_count.comp are wired in runtime/CMakeLists.txt. "ExecuteIndirect signatures that change root arguments" stays listed as open. The other text of the row is unchanged (diff is a single clause). The runtime test itself was not run (GPU not used for a docs change). No issues found.

The M4 "Still open" list kept "ExecuteIndirect signatures that ... use count buffers for
dispatches". Replay resolves the count buffer for dispatch signatures (vulkan_replay.h, around the
"Vulkan lacks vkCmdDispatchIndirectCount" path) and d3d12_indirect_dispatch_count_test compares the
counts with native D3D12. Keep the root-argument clause, drop the count-buffer one.
…e no longer open

CreateConstantBufferView writes a V# for the CBV and buffer SRVs (raw, structured, typed) are built
in CreateShaderResourceView; d3d12_compute_test checks both. The per-call trace exists
(runtime/shims/d3d12_trace.h) and check_d3d12_trace.py, registered in CMake, checks its sequence.
@Pierre-Kookis

Copy link
Copy Markdown
Contributor Author

Rebased on main and added 39792f00: two more stale "Still open" entries in the same §6 table, claimed in #4933.

  • M4: "buffer SRVs and CBVs as V#s" dropped. CreateConstantBufferView writes a V# (runtime/shims/d3d12_vulkan_device.cpp:5423-5436), buffer SRVs are built in CreateShaderResourceView (:5457+), and d3d12_compute_test checks both.
  • M0: the per-call trace is in place (runtime/shims/d3d12_trace.h, checked by runtime/test/check_d3d12_trace.py, registered in runtime/CMakeLists.txt:1285). The game's present front end stays open.

test_docs*.py: OK.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 39792f0 merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass.

Docs-only (docs/d3d12_vulkan.md, section 6 M0 and M4 rows). I did not build the runtime. Ran the 10 tests/test_docs_*.py files with -I: all OK.
Checked each new claim against the merged tree: runtime/shims/d3d12_trace.h and runtime/test/check_d3d12_trace.py exist and the latter is registered as the d3d12_trace CTest; CreateShaderResourceView writes a buffer V# (raw/structured/typed) and CreateConstantBufferView writes a V#; ExecuteIndirect records the count buffer and runtime/test/d3d12_indirect_dispatch_count_test.cpp exists.
Negative control: not meaningful for a docs-only change, the doc tests also pass on main's copy of the file. Whether the tests named in the docs pass on a GPU is not covered here.

@memorypressure

Copy link
Copy Markdown

Verified on current main (3faac55, which this PR sits directly on). All three status claims check out against main (each commit verified present): the per-call trace files exist (runtime/shims/d3d12_trace.h, runtime/test/check_d3d12_trace.py, from 4e1de42); buffer SRVs/CBVs were implemented by 07e2293 and eda19ca; counted indirect dispatch by c262fb7 with its test. All five docs guards pass. Two notes: the section 3 body still calls buffer SRV/CBV views not written (docs/d3d12_vulkan.md around lines 630 and 842) while the table row now marks them done — worth folding those lines in; and #3634 edits the same milestone rows but is stale against current main. No CI checks reported on this branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

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