Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Texture2D.CreateExternalTexture issue

Discussion in 'Unity 5 Pre-order Beta' started by lawrence.ward, Jan 19, 2015.

  1. lawrence.ward

    lawrence.ward

    Joined:
    May 13, 2014
    Posts:
    7
    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?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    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?
     
  3. lawrence.ward

    lawrence.ward

    Joined:
    May 13, 2014
    Posts:
    7
    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.
     

    Attached Files:

  4. lawrence.ward

    lawrence.ward

    Joined:
    May 13, 2014
    Posts:
    7
    Sorry - targeting ES2.0 on iPhone. We have observed the same problem on Android though.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Looks like something goes wrong. Could you report a bug with a minimalistic repro case attached?
     
  6. lawrence.ward

    lawrence.ward

    Joined:
    May 13, 2014
    Posts:
    7
    I have submitted a bug now with the Unity sample app. Let me know if you need anything else from the report
     
    dylan-hart likes this.
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Thanks. We'll take a look at it.
     
  8. lawrence.ward

    lawrence.ward

    Joined:
    May 13, 2014
    Posts:
    7
    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?
     
    dylan-hart likes this.