Sitelet https://github.com/microsoft/DirectX-Graphics-Samples/pull/974
Skip to content

Batched Async Commands sample - #974

Draft
alexgong14 wants to merge 15 commits into
masterfrom
user/alexgong/aynccommandssample
Draft

alexgong14 wants to merge 15 commits into
masterfrom
user/alexgong/aynccommandssample

Conversation

@alexgong14

Copy link
Copy Markdown

No description provided.

Zichuan Gong and others added 12 commits September 8, 2026 15:39
Add the standard MIT copyright block required on every source file in this
repo, matching the layout used by the other self-contained console samples.

Correct the file header comment, which listed three benchmarked command pairs
while the sample implements ten.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Async Commands is retail from Agility SDK 620, so the sample no longer needs
the experimental opt-in. Query the async methods from the graphics command list
itself rather than a separate interface, and report whether the runtime supplied
a native or a fallback implementation, since the benchmark comparisons are only
meaningful on a native one.

NOTE: the Agility SDK package pin is a local build used to verify this change
ahead of the public 1.620 release. It must be repointed at the published
version before this is shared.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass -fallback to opt into D3D12ExperimentalForceAsyncCommandsFallback, which
lowers the async commands onto their legacy counterparts and shows the behaviour
a driver without native support gives.

Only CopyBufferRegions, CopyResources, CopyTextureRegions and ResolveQueryDataAsync
have a runtime lowering; the rest reject the call when the fallback is forced, so
the mode exercises just those four and skips the triangle, which clears with
ClearBoundRenderTargetViews.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the published Agility SDK 620 package.

Verify the render target properly: check that a corner still holds the async
clear color and that the centre does not, and fail the sample when it does not
hold. Previously the check could only ever report success.

Drive the benchmarks from a table so the set is declared once and the commands
that lack a runtime fallback are filtered rather than duplicated in a second
code path.

Close the fence event, check CreateEvent and EnumAdapterByLuid, parenthesise the
PRINT macro argument, and trim comments to the points that are not obvious from
the code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Print the adapter description, vendor and device IDs, user-mode driver version
and implementation tier, so a benchmark run records which driver produced it.

Add -list to enumerate adapters and -adapter to pick one. A machine with more
than one GPU would otherwise silently benchmark whichever adapter D3D12 chose.

When an adapter is named explicitly, do not substitute WARP if it lacks async
command support; report it and exit non-zero instead. Silently falling back
would hide exactly the case a driver test needs to catch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

First quick pass at comments :)

Comment thread Samples/Desktop/D3D12AsyncCommands/src/D3D12AsyncCommands.cpp
Comment thread Samples/Desktop/D3D12AsyncCommands/src/D3D12AsyncCommands.cpp
Comment thread Samples/Desktop/D3D12AsyncCommands/src/D3D12AsyncCommands.cpp
Zichuan Gong added 3 commits September 29, 2026 16:08
- Transition FillBuffers/ClearUAV resources between COPY_DEST and UAV in both microbench and e2e paths\n- Use explicit LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE flags for CopyTiles/CopyTilesAsync\n- Add -debuglayer option and document fail-fast behavior when unavailable\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename local boolean from wantDebugLayer to shouldEnableDebugLayer to better reflect intent and avoid state ambiguity.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor BenchmarkTextureClear to use RunLoop with explicit layout-prep lambdas, keeping transition work outside measured timings and aligning benchmark structure with other tests.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

2 participants