Up to Beta 18 we have noticed an issue with Texture2D.CreateExternalTexture.
It appears to stomp on the uploaded texture (perhaps calling apply) after creation.
We don’t observer this behaviour with UpdateExternalTexture, however the creation of the texture seems to allocate a significant amount of extra memory and we are seeing a larger impact on memory in our application.
We have released the data uploaded to the GPU, but we aren’t too sure what else we can clean up from the texture creation process.
Are there any workarounds to this issue and is this a known issue with CreateExternalTexture?
Hi,
CreateExternalTexture should definitely not allocate any memory from Unity side. Also, what do you mean by “stomp the uploaded texture”? Does the texture become corrupt? What is your target platform and graphics API?
Yeah its odd, it seems to be storing local information in SharedTextureData on creation for some reason. You can also see the call to upload in the screenshot that is called and uploads what looks like the default texture data to the GPU overwriting what we already had on the GPU. See 2nd screenshot.
Sorry - targeting ES2.0 on iPhone. We have observed the same problem on Android though.
Looks like something goes wrong. Could you report a bug with a minimalistic repro case attached?
I have submitted a bug now with the Unity sample app. Let me know if you need anything else from the report
1 Like
Thanks. We’ll take a look at it.
I just checked against Unity 5.0 RC1 and the issue still occurs, is this something that will be addressed for the final version or will the issue still be around for the final dist?
1 Like