Skip to content

Automatically rename player process name at runtime to captured application name#2816

Open
jravi-amd wants to merge 6 commits into
LunarG:devfrom
jravi-amd:dev-process-name-override
Open

Automatically rename player process name at runtime to captured application name#2816
jravi-amd wants to merge 6 commits into
LunarG:devfrom
jravi-amd:dev-process-name-override

Conversation

@jravi-amd

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR effectively replaces the functionality in scripts\gfxrecon-replay-renamed.py. Currently supported only on Windows.

How does this work?

On Windows to get the current process name, apps call GetModuleFilename with NULL hModule. This returns the current process name. Graphics drivers often rely on filename returned by this function to apply application-specific optimizations and settings.

On replay during initialization, Microsoft Detours is used to hook GetModuleFilename with our version. So when a graphics driver makes a call to GetModuleFilename(A/W), it gets redirected to our hooked version.

When the replay consumer encounters a process exe name packet in the metadata, we set the original app name in process name override file via a callback from the consumer. The hooked version now returns the original app's exe name instead of gfxrecon-replay.exe.

From the driver's perspective, it receives the original application's process name instead of the replay tool's name. This ensures that application-specific driver optimizations and profiles are correctly applied during replay.

Why do this?

Convenience. Ease of use. Invoking the player as usual, gfxrecon-replay.exe <trace>, should handle process name overrides.

@jravi-amd
jravi-amd requested a review from a team as a code owner March 24, 2026 22:08
@CLAassistant

CLAassistant commented Mar 24, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@davidd-lunarg davidd-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Mar 24, 2026

@davidd-lunarg davidd-lunarg 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.

The documentation about renaming scripts should be updated to mention the new default behavior for Windows. https://github.com/LunarG/gfxreconstruct/blob/dev/USAGE_desktop_D3D12.md#renaming-scripts

That section should also be copied to USAGE_desktop_Vulkan.md. The new replay flag --disable-process-name-override should be added to the usage documents as well.

Comment thread tools/optimize/dx12_optimize_util.cpp Outdated
Comment thread framework/util/process_name_override.cpp Outdated
Comment thread tools/replay/replay_settings.h Outdated
@jravi-amd
jravi-amd force-pushed the dev-process-name-override branch from 5cc7dc1 to 5eb6bd7 Compare April 14, 2026 20:13
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