Skip to content

Shaders: enable VICTORY_D3D12_DEBUG and report InfoQueue errors on pipeline refusal - #2560

Closed
ashrafsdrop wants to merge 1 commit into
Marvisak:mainfrom
ashrafsdrop:shader/host-d3d12-debug-2537
Closed

ashrafsdrop wants to merge 1 commit into
Marvisak:mainfrom
ashrafsdrop:shader/host-d3d12-debug-2537

Conversation

@ashrafsdrop

Copy link
Copy Markdown

Resolves #2537:

Summary

  • In crates/victory-shader/src/emit/host.rs, Host::new previously ignored VICTORY_D3D12_DEBUG=1, so victory translate --pipelines reported bare HRESULT codes on pipeline refusals without any D3D12 debug layer diagnostics.
  • Enabled ID3D12Debug::EnableDebugLayer in Host::new before D3D12CreateDevice when VICTORY_D3D12_DEBUG=1 is set.
  • Routed compute (compute_pipeline_with), graphics (pipeline_gs), and mesh (mesh_pipeline_with) pipeline creation through Host::create_pipeline:
    • When VICTORY_D3D12_DEBUG=1 is unset, runs lock-free in parallel across workers.
    • When VICTORY_D3D12_DEBUG=1 is set, serializes pipeline creation and ID3D12InfoQueue clear/drain under a static Mutex so concurrent census workers sharing the adapter's D3D12 device never clear or steal each other's messages, and appends the first D3D12 error message to the returned error string.

Verification

  • Added emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure (passes with VICTORY_D3D12_DEBUG=1 on WARP).
  • cargo test -p victory-shader --lib emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure (1 passed).
  • cargo clippy -p victory-shader --all-targets --all-features -- -D warnings (clean).
  • cargo run -p xtask -- policy (184 files ok).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Proposed close. Duplicate of #2562. This enables the D3D12 debug layer in emit::host::create_device under VICTORY_D3D12_DEBUG=1 and adds the first ID3D12InfoQueue error to pipeline-creation failures. #2562 covers the same goal (#2537) more completely: it gates on the diagnostics feature like victory-gpu/src/host.rs, enables the layer once before the process's first device, reports refused root signatures too, and adds --only. Two points from the earlier review are also still open here: the layer is enabled inside create_device rather than once per process, and create_pipeline calls ClearStoredMessages on the shared device's queue. If something here is missing from #2562, please raise it there.

CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

@KainanP

KainanP commented Nov 25, 2026

Copy link
Copy Markdown

Compared with #2562 on an RTX 4060 and WARP (no debug layer here). It adds no regressions, but it now conflicts with main and #2562, and it lacks the diagnostics gating, the root signatures and --only. Details: #2537 (comment) (AI-assisted)

…peline refusal

Resolves Marvisak#2537:

- Enable ID3D12Debug layer in victory_shader::emit::host::Host::new when VICTORY_D3D12_DEBUG=1 is set.
- Serialize pipeline creation and ID3D12InfoQueue clear/drain under a process-wide mutex only when VICTORY_D3D12_DEBUG=1 so parallel census workers never steal each other's messages while non-debug runs remain lock-free.
- Append the first D3D12 debug error message to pipeline refusal errors across compute, graphics, and mesh pipeline creation.
- Add debug_pipeline_creation_drains_info_queue_on_failure unit test.
@ashrafsdrop

Copy link
Copy Markdown
Author

Closing in favor of #2562 which covers the diagnostics gating, once-per-process init, and --only flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

translate --pipelines: VICTORY_D3D12_DEBUG never reaches the device it creates, so pipeline refusals carry no driver reason

3 participants