CHANGE: Use ProfilerMarker in place of Profiler based on Unity version and presence of com.unity.profiling.core package#1970
Merged
stefanunity merged 12 commits intodevelopfrom Jul 30, 2024
Conversation
0ee8084 to
0b8ff75
Compare
…ossible to enable capturing of data from ProfilerRecorders.
0b8ff75 to
75e445c
Compare
This reverts commit 01ab46c.
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.
Description
Use
ProfilerMarkerinstead ofProfiler.[Begin|End]Samplewhen thecom.unity.profiling.corepackage is present at version1.0.2and the Unity version is 2020.3 or greater.Changes made
A wrapper class,
InputProfilerMarker, was added to encapsulate the#ifdeflogic for usingProfilerMakervs.Profiler. Most places that used to callProfilernow callInputProfilerMarker.Testing
I ran a handful of tests on Yamato. The code analyzer test made me realize that I need to conditionally compile my changes based on the Unity Version and the presence of the
com.unity.profiling.corepackage.I also tested to ensure that the markers show up in the Profiler Window Timeline for both cases on a test project.
Risk
I believe the risk of this change is low as there are no feature changes or logic changes; it just replaces one profiler call with another based on the Unity version and package presence.
Checklist
Before review:
Changed,Fixed,Addedsections.Tests added/changed, if applicable.Functional testsArea_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.Performance tests.Integration tests.Docs for new/changed API's.Xmldoc cross references are set correctly.Added explanation how the API works.Usage code examples added.The manual is updated, if needed.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: