Search Issue Tracker
Fixed in 2.0.0
Votes
0
Found in [Package]
1.0.1 preview
Issue ID
1097050
Regression
No
384B GC Alloc in GUIUtility.BeginGUI when using Pixel Perfect Camera
Steps to reproduce:
1. Create new project
2. Import 2D Pixel Perfect package
3. Add Pixel Perfect Camera component to the Main Camera
4. Enter Playmode
5. Open Profiler and look at GC Alloc
Expected result: no extra GC Alloc
Actual result: Extra 384 B in GC only when Pixel Perfect Camera is enabled
Reproducible with: 2018.2.20f1, 2018.3.1f1, 2019.1.0a12
Reproducible with: 1.0.1 preview
-
PauliSavolainen
Jul 20, 2020 06:16
I would suggest to create a separate component such as PixelPerfectDebug attached to the PixelPerfectCamera and move the OnGUI implementation to the debug component. Only when there is something to show the debug component would be enabled. This way OnGUI wouldn't cause GC even in editor/development mode. It is somewhat annoying to see the 384B when profiling in the editor.
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
- onDisable not always called for SearchProvider
- Build failure errors are cleared in console before you can read them
- Sprite Library Editor contains corrupted and low resolution icons
- [Linux] Players Application window does not update on move when window is changed from full-screen mode
- [Lost Crypt] Build fails in U6
Resolution Note (fix version 2.0.0):
The GC allocation is caused by having an OnGUI() callback in the PixelPerfectCamera component. I made OnGUI() only available in the Editor and development builds, as I think it's still useful to have on-screen warning messages, but the GC allocation will be gone in non-development player builds.