Skip to content

Split Replay into Features for easier expansion#2927

Open
MarkY-LunarG wants to merge 12 commits into
LunarG:devfrom
MarkY-LunarG:marky-dev-split-up-replay
Open

Split Replay into Features for easier expansion#2927
MarkY-LunarG wants to merge 12 commits into
LunarG:devfrom
MarkY-LunarG:marky-dev-split-up-replay

Conversation

@MarkY-LunarG
Copy link
Copy Markdown
Contributor

This change continues on the Split previously done on both the gfxrrecon-info and the gfxrecon-convert tools to attempt to make it easier to expand new APIs into the tools without conflicting with existing changes.

@MarkY-LunarG MarkY-LunarG requested a review from a team as a code owner May 5, 2026 22:26
@MarkY-LunarG MarkY-LunarG added approved-to-run-ci Can run CI check on internal LunarG machines labels May 11, 2026
@MarkY-LunarG MarkY-LunarG force-pushed the marky-dev-split-up-replay branch from 0b31d0f to c85801a Compare May 11, 2026 16:59
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 11, 2026

CLA assistant check
All committers have signed the CLA.

Problem was we did not free replay_consumers until after we
had already released the logging.  So, add them to be released
during hte Cleanup stage.
All 3 features supported here had a lot of common functionality
which could be reduced down using a template base.
Add a second template base for pre-processing support to clean
up some more duplication
This adds in the initial simpler feature interface and includes
the necessary Windows and Android fixes.
@MarkY-LunarG MarkY-LunarG force-pushed the marky-dev-split-up-replay branch from bc5161a to 24a322e Compare May 11, 2026 21:22
Copy link
Copy Markdown
Contributor

@mikes-lunarg mikes-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see why you didn't do this one first, lots to untangle here!

Comment thread tools/replay/android_main.cpp Outdated
kApplicationName, g_file_processor.get(), VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, app);

if (replay_options.capture)
for (auto& feature : g_features)
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.

There is a non-trivial amount of logic duplicated between desktop_main.cpp and android_main.cpp, we should definitely pull that into a common implementation

Copy link
Copy Markdown
Contributor Author

@MarkY-LunarG MarkY-LunarG May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just making this change. I have a pending change which pulls out a majority of the commonality between these two files. I agree, having duplicate code in two separate files is prone to breakage. I'll push it up when I address the other comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikes-lunarg , the changes are in for the common code split

Comment thread tools/replay/android_main.cpp Outdated
Comment on lines +207 to +211
feature->QueryFpsInfoOptions(quit_after_measurement_frame_range,
flush_measurement_frame_range,
flush_inside_measurement_range,
preload_measurement_frame_range,
quit_after_frame);
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.

I think it makes more sense for the replay main to parse the common options. Here, the different features duplicate work and could potentially stomp on each other.

Copy link
Copy Markdown
Contributor Author

@MarkY-LunarG MarkY-LunarG May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that each API has it's own "ReplayOptions" structure that this info is stored inside. For example, for Dx12, they use DxReplayOptions and Vulkan uses VulkanReplayOptions structures.

That's why it's a Feature call.

Comment thread tools/replay/android_main.cpp Outdated
Comment thread tools/replay/android_main.cpp Outdated
Comment on lines +88 to +89
file_processor_->SetPrintBlockInfoFlag(
replay_options_.enable_print_block_info, replay_options_.block_index_from, replay_options_.block_index_to);
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.

I think this can be moved out to replay main, it isn't vulkan specific

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replay_options_ is Vulkan specific and even in the old path these were only set if Vulkan was enabled. No change has been made to behavior here.

Comment thread tools/replay/replay_vulkan_feature.cpp Outdated
Comment thread tools/replay/replay_vulkan_feature.cpp Outdated
Both android_main.cpp and desktop_main.cpp shared a lot of common
code.  This is bad and could lead to seperation in behaviors in
the long run.
So, pull out the common code instead.
This includes pulling out the core of desktop_main.cpp and
android_main.cpp into a new set of files (a .h and a .cpp) which
allows the common code to exist in a single location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants