Search Unity

ETC2 compression using GLES2 API on a GLES3-compatible device

Discussion in 'Android' started by TommyTheITGuy, Mar 27, 2019.

  1. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Hello. I have the following question. Is it possible for an Android Device to support GLES3, but not support ETC2 in GLES2? I have an Android game, where I only enable GLES2 API, as I want the game to run on some older devices. The game crashes at some point while loading assets and logcat report a memory allocation failure by Unity when trying to allocate memory for a texture. It tries to allocate 16MB of RAM, which would correspond to an RGBA32 2k texture. All my atlases are are compressed to crunched ETC2.

    Does this mean, that having only enabled GLES2 API in build it can run on a GLES3 device using GLES2 API, but does not use ETC2 compression (decompressing them on load), because it does not support the needed extension?

    This is on Unity 2017.4.23 and I'm using the new Sprite Atlases. The GPU is Adreno 330.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,023
    If you create a GLES2 context on a GLES3-capable device, you get full GLES2 functionality and extensions supported for GLES2 only.
    There is no way to get ETC2 on GLES2 context.
    All ETC2 texture will be decompressed to whatever format is set in the build settings under ETC2 fallback.
     
    TommyTheITGuy likes this.