Search Issue Tracker
Fixed in 2018.2.X
Votes
6
Found in
2017.1.0f3
Issue ID
933234
Regression
Yes
[Metal] Texture2D.GetNativeTexturePtr creates a new texture and returns pointer to the new texture instead of the original
To reproduce:
1. Open project attached by the user
2. Open "MainScene" scene
3. In Edit->Project Settings -> Player enable Metal support for the editor
4. Hit play
Expected: Both textures should have the same color because the second texture is just a pointer to the original one.
Actual: Color is changed only on original texture which means that a new texture was created and Texture2D.GetNativeTexturePtr returned a pointer to this new texture.
Reproduced with: 2017.1.0b1, 2017.1.0p1, 2017.2.0b4, 2017.3.0a1
Not reproducible with 5.6.2p4
Reproduces only on Metal API, OpenGL works as expected.
Fixed in Unity 2018.2.0a1
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
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
blunzn
Feb 15, 2018 15:28
Also having trouble with GetNativeTexturePtr on Metal. Last known working version is 5.6.4p1, still persists in 2017.3.1p1.
For me the problem is not calling GetNativeTexturePtr (returned pointer stays the same when i call it multiple times in one frame), but using Texture2D.SetPixels and Texture2D.Apply. After those calls, GetNativeTexturePtr returns new values each time - only on Metal.