Search Issue Tracker
By Design
Votes
0
Found in
2019.3
2019.3.0f6
2020.1
2020.2
Issue ID
1219431
Regression
No
CustomSampler.GetReporter().elapsedNanoseconds returns 0 in code when the first frame takes longer than a second to compute
Reproduction steps:
1. Open the attached project ("case_1219431-BRep.zip")
2. Open the repro scene ("main")
3. Enter Play Mode and wait for the cubes to load
4. Inspect the GUI on the lower right corner of the Game View
Expected result: Information about loading times can be seen
Actual result: Text fields remain empty (CustomSampler.GetReporter().elapsedNanoseconds returns 0)
Reproducible with: 2019.3.6f1, 2020.1.0b2, 2020.2.0a3
Couldn't test with: 2017.4, 2018.4 (project breaking after downgrade)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Prefab Overrides “Apply” button is too big and overlaps with the context menu’s outline
- Prefab Overrides “No Overrides” text is too large, and the the Context Menu of the Parent GameObject has a lot of empty space when opened
- “Screen position out of view frustum...” errors are thrown when zooming out in the Scene view after creating UI GameObject
- CurveTexture is not being released when unloading AssetBundle containing a Scene with ColorCurves post-processing component in Global Volume
- Crash on ExtractActiveCasterInfo when navigating the scene view in a project with specific lighting data
Resolution Note (2020.2.X):
The 0 data reported by Recorder is due to the design decision that sampler.GetRecorder() creates a new recorder.
This results in the situation where a recorder object created on stack is garbage collected disabled and disposed.
Basically Update method with usage like sampler.GetRecorder().elapsedNanoSeconds always returns 0 being a new recorder.
A workaround for this would be to use a member variable to store recorder instance in the class.