Search Unity

Bug New a Texture2D of format RGBA_ETC2_UNorm with mipmaps can cause EXC_BAD_ACCESS on iOS

Discussion in 'General Graphics' started by zhutianlun810, Jul 27, 2021.

  1. zhutianlun810

    zhutianlun810

    Joined:
    Sep 17, 2017
    Posts:
    168
    Hello,

    I am facing a bug in my little project. I am creating a Texture2D of format RGBA_ETC2_UNorm with 8 mipmaps at runtime:

    Code (CSharp):
    1. GraphicsFormat format = GraphicsFormat.RGBA_ETC2_UNorm;
    2. int mipmapCount = 8;
    3. Texture2D copyTex = new Texture2D(width, height, format, mipmapCount, TextureCreationFlags.None);
    I found these three line of code work perfectly on Android. However, they will cause EXC_BAD_ACCESS on iOS.

    The XCode shows that EXC_BAD_ACCESS is triggered in function UploadMipPyramid [inlined]. Any ideas?