Automatically rename player process name at runtime to captured application name#2816
Open
jravi-amd wants to merge 1 commit intoLunarG:devfrom
Open
Automatically rename player process name at runtime to captured application name#2816jravi-amd wants to merge 1 commit intoLunarG:devfrom
jravi-amd wants to merge 1 commit intoLunarG:devfrom
Conversation
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.