Skip to content

GPU: add opt-in D3D12 pipeline validation diagnostics - #59

Open
RoachxD wants to merge 1 commit into
DexNom:mainfrom
RoachxD:feat/d3d12-pso-diagnostics
Open

RoachxD wants to merge 1 commit into
DexNom:mainfrom
RoachxD:feat/d3d12-pso-diagnostics

Conversation

@RoachxD

@RoachxD RoachxD commented Nov 26, 2026

Copy link
Copy Markdown

Summary

  • Report debug-layer and InfoQueue activation and register an InfoQueue1 callback where supported.
  • Correlate root/pipeline load/create results with same-thread validation messages using bounded attempt IDs; report messages without a scope as unassigned.
  • Keep expected pipeline-library misses at debug level with separate quotas from creation failures. Document opt-in controls, limitations and a sanitized wave-size validation example.

Microsoft documents that callbacks can run on a different thread and must not call D3D APIs from the callback (https://devblogs.microsoft.com/directx/d3d12-debug-layer-message-callback/). This implementation has no D3D API calls in the callback, uses process-lifetime state with no borrowed context, and catches unwinds. The device belongs to a process-lifetime singleton; explicit unregister would be required if this lifetime changes. Logging is synchronous and opt-in; attribution is temporal, not causal. Unassigned messages have a separate bounded quota. The legacy queue remains available for device-removed diagnostics.

Validation

An earlier version was exercised on native NVIDIA hardware and distinguished ID 622 during pipeline creation from ID 971 during pipeline-library load. The revised standalone contribution passed Windows-target test compilation checks with and without the diagnostics feature, and the native Windows bounded_counter_and_nested_scope test (one passed, 209 filtered out). Asset-policy and diff checks passed. The identical five-file revised implementation was subsequently exercised in a native Windows startup on an RTX 3060 Laptop GPU, combined with PR #40 solely for validation. InfoQueue1 callback registration succeeded. Four targeted compute PSOs each missed the pipeline library; two were created successfully and two failed with message 622 (requested wave64 on a wave32-only device). The process exited normally. The 64-message unassigned quota was exhausted, including 62 cache misses; targeted diagnostics remained functional. Separating unassigned cache misses is a possible follow-up. Repository-wide rustfmt checks report existing deviations and six new or modified formatting hunks; the reviewed, native-tested tree is retained. PR #40 is excluded from this contribution. No rendering correctness or performance claim. No game-specific filters, shader extraction or compatibility workaround included (the optional hash selector only limits diagnostic logging).

AI assistance was used to develop and review this contribution. The author is responsible for the changes.

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.

1 participant