Search Issue Tracker
Fixed in 5.3.3
[RenderTexture] GetNativeTexturePtr call on Antialiased Depth texture returns IntPtr.Zero
An extra function has been added to the D3D11 Native Rendering interface to allow for the retrieval of the native ID3DTexture type from a Unity RenderBuffer.
In order to replicate the previous functionality you will need to obtain the RenderBuffer for the depth buffer from the render target and pass it in to this function on the D3D Native Interface.
Steps to reproduce:
1. Open attached project
2. Open scene "testScene"
3. Open script "test.cs"
4. Notice that it creates Depth RenderTexture and sets it Antialiasing to 8. The "GetNativeTexturePtr is called on that texture. If IntPtr.Zero is returned then NULL is printed to console
5. Run scene and notice that NULL is printed in console
6. Stop the scene and in test.cs set antiAliasing property to 1
7. Run scene again and notice that NULL is no longer printed
8. Stop the scene and in test.cs set antiAliasing back to 8
9. In RenderTexture constructor (line 11), change RenderTextureFormat.Depth to RenderTextureFormat.Default
10. Run scene again ant notice that NULL isn't printed as well.
Reproduced with: 5.0.4f1, 5.1.4f1, 5.2.3p2, 5.3.0f4, 5.4.0a6
Not reproducible: 5.0.1f1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Tabbed headers in editor windows need a style update
- [Android][IL2CPP] App crashes after executing Application.Quit
- [iOS] ReplayKit.APIAvailable returns 'false' on the first call on iOS 13 devices
- Texture preview can be clicked through
- [Progress] Progress bar does not revert to unresponsive status after another task completes