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
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 override popup is cropped/positioned incorrectly when more than one display is used and a higher display Scale is set
- Opening a dropdown on a small screen results in its instant closing when mouse cursor is pressed where the dropdown is going to be opened
- Only "ArgumentNullException: Value cannot be null" is displayed instead of all the actual errors when opening a project with numerous compilation errors
- MultiColumnListView and MultiColumnTreeView do not change selection on first input when focus is set by code
- SerializedProperty.DataEquals is returning false when SerializedProperty.EqualContents return true
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.