Skip to content

Isolate render passes during replay (#3016) - #42

Open
olehkuznetsov wants to merge 1 commit into
android-graphics:devfrom
olehkuznetsov:cherry-pick-pr-3016
Open

olehkuznetsov wants to merge 1 commit into
android-graphics:devfrom
olehkuznetsov:cherry-pick-pr-3016

Conversation

@olehkuznetsov

Copy link
Copy Markdown

Cherry-pick of upstream commit LunarG/gfxreconstruct@9a83f8a (PR #3016).

Note

This is a prerequisite for #41 (--serialize-compute-and-transfer), which uses the capture_and_replay() test helper introduced here.

Upstream Description

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.

Changes

  • Add framework/decode/vulkan_command_splitter.{h,cpp}, hooked into OverrideCmdBeginRenderPass, OverrideCmdEndRenderPass, OverrideQueueSubmit, OverrideBeginCommandBuffer, and OverrideResetCommandBuffer.
  • Add OverrideCreateCommandPool so the splitter can tell whether the pool was created with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT (implicit reset on vkBeginCommandBuffer).
  • 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 the capture_and_replay() test helper (test/verify-gfxr.{h,cpp}), which captures a test app and replays the resulting gfxr headless (--swapchain offscreen) against the mock ICD, asserting the replay exits cleanly. This makes gfxrecon-replay a build dependency of gfxrecon-testapp-runner and installs it into the test directory.
  • Add an isolate-render-passes test app and test case.

Cherry-pick notes

Upstream replaces typedef VulkanPoolInfo<VkCommandPool> VulkanCommandPoolInfo; with a struct carrying a create_flags member, relocated further down vulkan_object_info.h. This fork already declares VulkanCommandPoolInfo as a struct with a flags member (plus queue_family_index, used by vulkan_replay_frame_loop_consumer.cpp), so the upstream struct was dropped and its two uses now read the pre-existing flags field. No existing call sites were renamed.

The tools/replay/replay_settings.h option list was merged to keep this fork's --screenshot-apply-prerotation alongside the new --isolate-render-passes.

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