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
- "Assertion failed on expression" errors thrown in Console when opening Profiler (Standalone Process) window
- Skinned Mesh Renderer with multiple Animator Components does not render when "Optimize Game Objects" is enabled
- [iOS]Certain characters are not displayed when using iOS devices with 18 OS and newer
- Trees do not render in 'Unity Terrain - URP Demo Scene'
- Silent crash when clicking in Scene View in a specific project
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.