Skip to content

replay: Serialize compute and transfer operations (#3058) - #41

Open
olehkuznetsov wants to merge 2 commits into
android-graphics:devfrom
olehkuznetsov:cherry-pick-pr-3058
Open

olehkuznetsov wants to merge 2 commits into
android-graphics:devfrom
olehkuznetsov:cherry-pick-pr-3058

Conversation

@olehkuznetsov

Copy link
Copy Markdown

Cherry-pick of upstream commit LunarG/gfxreconstruct@a545b2a (PR #3058).

Upstream Description

Add a --serialize-compute-and-transfer option that injects a pipeline barrier before and after each compute dispatch, preventing compute and transfer/copy work from overlapping on the GPU.

Changes

  • Add OverrideCmdDispatch, OverrideCmdDispatchIndirect, and OverrideCmdDispatchBase replay overrides (registered in replay_overrides.json) that wrap every compute dispatch with MaybeInjectComputeTransferBarrier.
  • Plumb the new option through gfxrecon.py, replay_settings.h, and tool_settings.h, and document it in USAGE_android.md and USAGE_desktop_Vulkan.md.
  • Add a serialize-compute-and-transfer test app plus a smoke test case, wired into the desktop and Android test app launchers.

Cherry-pick notes

The upstream change is interleaved with the --isolate-render-passes option, which this fork does not carry. Those context hunks were dropped while resolving conflicts in:

  • USAGE_android.md, USAGE_desktop_Vulkan.md, android/scripts/gfxrecon.py
  • framework/decode/vulkan_replay_options.h, tools/tool_settings.h, tools/replay/replay_settings.h
  • test/CMakeLists.txt, test/test_apps/CMakeLists.txt, test/test_apps/launcher/CMakeLists.txt, test/test_apps/launcher/test_launcher.cpp

Everything else (the replay consumer implementation, generated consumer, and the new test app) applied cleanly.

@google-cla

google-cla Bot commented Sep 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Add a --isolate-render-passes replay option backed by a new
VulkanCommandSplitter, which splits a command buffer at each render pass
boundary and submits the segments separately, chained through a
semaphore. It is hooked into OverrideCmdBegin/EndRenderPass,
OverrideQueueSubmit, OverrideBeginCommandBuffer, and
OverrideResetCommandBuffer.

Also adds the capture_and_replay() test helper, which captures a test
app and replays the resulting gfxr headless against the mock ICD, plus
an isolate-render-passes test app and test case exercising it.

Cherry-pick notes: this fork already declares VulkanCommandPoolInfo as a
struct with a `flags` member (alongside `queue_family_index`, used by the
frame loop consumer), so the upstream `create_flags` member was dropped
and its two uses now read the pre-existing field.

(cherry picked from commit 9a83f8a)

Change-Id: I8ade75b52d52d66bdd6ccfaf34d5f7fd6a6a6964
Add a --serialize-compute-and-transfer option that injects a pipeline
barrier before and after each compute dispatch, preventing compute and
transfer/copy work from overlapping on the GPU.

- Add OverrideCmdDispatch, OverrideCmdDispatchIndirect, and
  OverrideCmdDispatchBase replay overrides that wrap every compute
  dispatch with MaybeInjectComputeTransferBarrier.
- Plumb the new option through gfxrecon.py, replay_settings.h and
  tool_settings.h, and document it in USAGE_android.md and
  USAGE_desktop_Vulkan.md.
- Add a serialize-compute-and-transfer test app and smoke test case,
  which uses the capture_and_replay() helper introduced by LunarG#3016.

(cherry picked from commit a545b2a)

Change-Id: If66ad74d38c8d3a97fb4bd02bf6761a26a6a6964
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