Use ProfilerMarker instead of Profiler.[Begin|End]Sample when the com.unity.profiling.core package is present at version 1.0.2 and the Unity version is 2020.3 or greater.
Changes made
A wrapper class, InputProfilerMarker, was added to encapsulate the #ifdef logic for using ProfilerMaker vs. Profiler. Most places that used to call Profiler now call InputProfilerMarker.
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.core package.
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:
[x] Changelog entry added.
Explains the change in Changed, Fixed, Added sections.
For API change contains an example snippet and/or migration example.
JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
Description
Use
ProfilerMarker
instead ofProfiler.[Begin|End]Sample
when thecom.unity.profiling.core
package is present at version1.0.2
and the Unity version is 2020.3 or greater.Changes made
A wrapper class,
InputProfilerMarker
, was added to encapsulate the#ifdef
logic for usingProfilerMaker
vs.Profiler
. Most places that used to callProfiler
now 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.core
package.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
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.~During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: