Automatically rename player process name at runtime to captured application name#2816
Open
jravi-amd wants to merge 6 commits intoLunarG:devfrom
Open
Automatically rename player process name at runtime to captured application name#2816jravi-amd wants to merge 6 commits intoLunarG:devfrom
jravi-amd wants to merge 6 commits intoLunarG:devfrom
Conversation
davidd-lunarg
requested changes
Apr 7, 2026
Contributor
davidd-lunarg
left a comment
There was a problem hiding this comment.
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.
5cc7dc1 to
5eb6bd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
NULLhModule. 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
GetModuleFilenamewith 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.