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
Comments (1)
-
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
- "Font Asset Creator - Error Code [Invalid_File]..." error message is displayed when generating Font Atlas
- Baking Set-Default.CellProbeOcclusionData.bytes does not exist Warning is thrown when generating Lighting for Scene that contains Adaptive Probe Volume
- Crash on mono_custom_attrs_from_class_checked when metadata files are missing in a newly created or old project
- Crash on D3D12GetInterface or freeze in Player built with Direct3D12 when pressing "Esc" button while spectating after character's death
- A different Font Asset is applied when the original Font Asset is deleted while UI Builder is open
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.