Skip to content

d3d12_vulkan.md: graphics PSOs with MSAA are built; set-0 bindings need only a bindless set 0 - #5271

Open
Pierre-Kookis wants to merge 1 commit into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/d3d12-pso-refusals
Open

Pierre-Kookis wants to merge 1 commit into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/d3d12-pso-refusals

Conversation

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #5256.

Problem

The graphics-PSO refusal list in docs/d3d12_vulkan.md:751-752 (at 3faac557) still names MSAA and set-0 bindings:

  • MSAA PSOs are built: rasterizationSamples comes from the sample count (runtime/shims/d3d12_vulkan_device.cpp:2983), and runtime/test/d3d12_msaa_draw_test.cpp draws with a 4x PSO.
  • Set-0 bindings are refused only on a device without the bindless set 0 (:2795-2800, E_NOTIMPL with a log); otherwise the pipeline uses it, as runtime/test/d3d12_m2_textured_test.cpp does.

Change

Doc only: MSAA is dropped from the list and the set-0 entry says when it applies.

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.

…ed only a bindless set 0

The refusal list still named MSAA and set-0 bindings. MSAA PSOs set rasterizationSamples
(d3d12_msaa_draw_test draws with them), and set-0 bindings are refused only on a device
without the bindless set 0 (d3d12_m2_textured_test creates such PSOs).
@SweatierKey

Copy link
Copy Markdown
Contributor

Independent CPU verification on Linux (Python 3.13.5, head 9c11d8e7, base main 3faac557):

  • git diff --check main...HEAD — clean.
  • python3 -I -m unittest discover -s tests -p "test_docs*.py" -v — 30/30 OK.
  • Verified both claims directly against runtime/shims/d3d12_vulkan_device.cpp:
    • Set-0 bindings (:2795-2800): indeed refused with log + E_NOTIMPL only when !device_.bindless.
    • MSAA (:2720-2738, :2982-2986): standard MSAA (Quality == 0 or DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN) is built with multisample.rasterizationSamples = VkSampleCountFlagBits(samples).
    • Minor non-blocking note: DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN (D3D12_CENTER_MULTISAMPLE_PATTERN) is still refused with a log + E_NOTIMPL at :2730-2734 ("needs custom sample locations (not set yet)"), if you want to mention that exception in the refusal list; otherwise the current wording is already a clear improvement over the stale blanket "MSAA".

Looks good to merge.

@sovljanskii

Copy link
Copy Markdown
Contributor

Reviewed 9c11d8e7 against main 3faac557 by reading the code (the D3D12 tests are Windows-only, so none of them ran here). AI-assisted review. Both claims hold; the new list leaves out one refusal that still exists.

  • MSAA: rasterizationSamples comes from SampleDesc.Count (runtime/shims/d3d12_vulkan_device.cpp:2983), after the power-of-two and range check at :2720-2724. d3d12_msaa_draw_test builds and draws with a 4x PSO (:75, :133).
  • Set 0: E_NOTIMPL with a log only when !device_.bindless (:2795-2799). d3d12_m2_textured_test checks that its PS declares set-0 bindings (:114) and skips on a device without the bindless set 0 (:100).
  • python -I -m unittest discover -s tests -p "test_docs*.py": OK on CPython 3.12.

Gap: the centre sample pattern is still refused with a log. D3D12_CENTER_MULTISAMPLE_PATTERN returns E_NOTIMPL ("needs custom sample locations (not set yet)", :2729-2733), and the comment above create_graphics lists it among the refusals (:2685-2686). With MSAA gone from the list, docs/d3d12_vulkan.md no longer mentions that case anywhere. Adding "the centre multisample pattern (D3D12_CENTER_MULTISAMPLE_PATTERN, until custom sample locations are set)" to the list would keep the doc in line with the code.

Two more notes:

@King1565

Copy link
Copy Markdown

Read 9c11d8e: pass with notes

The changed line is correct (@SweatierKey covered the code). The same file still has stale text that contradicts it:

  • docs/d3d12_vulkan.md:798-800 and :838-840 ("Known gaps") still list "set 0 in pipelines (... no pipeline declares or binds it yet)" and "multisampled pipelines". Both are now built: d3d12_vulkan_device.cpp:3143-3147 puts set 0 in the graphics layout, and :2983 sets rasterizationSamples. The same lists still name "geometry ... pipelines", which doc :744-748 describes as supported.
  • docs/d3d12_vulkan.md:612 still says "Nothing in the layer creates such a pipeline yet." Doc :695 and d3d12_m2_textured_test.cpp:114,182 show that pipelines with set 0 exist.
  • Not a blocker: no graphics test covers the refusal when the device has no bindless set (d3d12_vulkan_device.cpp:2796-2799). d3d12_m2_textured_test.cpp:100 skips instead, and only compute has that case (d3d12_set0_compute_test, doc :1149).

AI-assisted (Claude Code).

@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.

Independent verification: PASS (code review + documentation test suite).

Checked against current codebase at 3faac557 on Windows 11 (Python 3.12.10):

  1. MSAA handling: Confirmed in runtime/shims/d3d12_vulkan_device.cpp:2982-2983:
    multisample.rasterizationSamples = VkSampleCountFlagBits(samples);
    MSAA PSOs are constructed using rasterizationSamples and exercised in runtime/test/d3d12_msaa_draw_test.cpp. It is not unconditionally refused.
  2. Set-0 bindings: Confirmed in runtime/shims/d3d12_vulkan_device.cpp:2795-2800:
    Set-0 bindings are only refused with E_NOTIMPL when !device_.bindless; otherwise they are permitted and register literal samplers (exercised in runtime/test/d3d12_m2_textured_test.cpp).
  3. Doc tests:
    python -I -m unittest discover -s tests -p "test_docs*.py": 30/30 passed.
    git diff --check: clean.

AI-assisted.

@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.

Reviewed 9c11d8e (one-line docs change vs 3faac55).

Checked the claim against the code: runtime/shims/d3d12_vulkan_device.cpp:2983 sets multisample.rasterizationSamples from the PSO's sample count (4x PSO drawn in runtime/test/d3d12_msaa_draw_test.cpp), and :2795-2801 refuses set-0 bindings only when device_.bindless is null (E_NOTIMPL with log); otherwise the layout uses the bindless set 0 (:3143-3147). Set-0 SRVs are created in runtime/test/d3d12_m2_textured_test.cpp:284-286.

Tested:

  • python -I -m unittest discover -s tests -p "test_docs*.py" -> Ran 30 tests in 21.5 s, OK.
  • python -I -m pytest tests/test_docs_design_rows.py -q -> 4 passed, 6 subtests.
  • git diff --check -> clean.

Verdict: accurate, doc-only; no blockers.

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.

6 participants