Skip to content

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

Open
jravi-amd wants to merge 1 commit intoLunarG: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 1 commit intoLunarG: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
Copy link
Copy Markdown

CLAassistant commented Mar 24, 2026

CLA assistant check
All committers have signed the CLA.

@davidd-lunarg davidd-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Mar 24, 2026
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