Search Issue Tracker
Fixed
Fixed in 2021.3.28f1
Votes
29
Found in
2021.3.27f1
Issue ID
UUM-3768
Regression
No
[M1] Editor/Player freezes when calling GetNativeTexturePtr
Reproduction steps:
1. Open users attached project
2. Open Assets/Test scene
3. Enter the Play Mode
Expected result: Play Mode is running
Actual result: Editor freezes after around 5-10 seconds
Reproducible with: 2021.2.19f1, 2022.1.0b15, 2022.2.0a9
Not reproducible with: 2019.4.37f1, 2020.3.32f1
Notes:
-also reproducible in Player
-sometimes it takes around a minute for Editor to freeze
-not reproducible with Rosseta
-only reproducible with M1
Comments (3)
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
KyryloKuzyk
May 11, 2023 07:31
I somewhat worked around the issue by caching the IntPtr returned from Texture2d.GetNativeTexturePtr().
Texture2D.LoadImage/LoadRawTextureData() modify the underlying native texture pointer, so I had to create a temporary texture first, then copy it to my desired texture with Graphics.CopyTexture(). Graphics.CopyTexture() preserves the original texture pointer, so it can be cached and reused.
Of course, this workaround has terrible performance, but in my case, it wasn't critical.
kassskata
Feb 23, 2023 09:41
Disscussing that issue in that post.
https://forum.unity.com/threads/texture-getnativetextureptr-may-not-return-on-m1-mac.1258506/#post-8826076
Reproduce it inside Unity's Native Rendering sample.
Andy-Block
Feb 22, 2023 12:22
I'm seeing the same on 2021.3.19f1 (on an M2) using a 3rd party utility called "Resource checker". It used to work fine on my Intel MacBook, but I just upgraded to the M2, and now it seems to freeze instantly every time I try to use it. Breaking in a debugger shows it is stuck in this method somehow.