docs: function textureLevelSize(format, width, height) {
      switch (format) {
          case COMPRESSED_RGB_S3TC_DXT1_EXT:
          case COMPRESSED_RGB_ATC_WEBGL:
          case COMPRESSED_RGB_ETC1_WEBGL:
              return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;
  
          case COMPRESSED_RGBA_S3TC_DXT3_EXT:
          case COMPRESSED_RGBA_S3TC_DXT5_EXT:
          case COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:
          case COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:
              return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;
  
          case COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
          case COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
              return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);
  
          case COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
          case COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
              return Math.floor((Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8);
  
      	//ASTC formats, https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/
          case COMPRESSED_RGBA_ASTC_4x4_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
              return Math.floor((width + 3) / 4) *  Math.floor((height + 3) / 4) * 16; 
          case COMPRESSED_RGBA_ASTC_5x4_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
              return Math.floor((width + 4) / 5) * Math.floor((height + 3) / 4) * 16;
          case COMPRESSED_RGBA_ASTC_5x5_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
              return Math.floor((width + 4) / 5) * Math.floor((height + 4) / 5) * 16;
          case COMPRESSED_RGBA_ASTC_6x5_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
              return Math.floor((width + 5) / 6) *  Math.floor((height + 4) / 5) * 16;
          case COMPRESSED_RGBA_ASTC_6x6_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
               return Math.floor((width + 5) / 6) * Math.floor((height + 5) / 6) * 16;
          case COMPRESSED_RGBA_ASTC_8x5_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
               return Math.floor((width + 7) / 8) * Math.floor((height + 4) / 5) * 16;
          case COMPRESSED_RGBA_ASTC_8x6_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
               return Math.floor((width + 7) / 8) * Math.floor((height + 5) / 6) * 16;
          case COMPRESSED_RGBA_ASTC_8x8_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
               return Math.floor((width + 7) / 8) * Math.floor((height + 7) / 8) * 16;
          case COMPRESSED_RGBA_ASTC_10x5_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
               return Math.floor((width + 9) / 10) * Math.floor((height + 4) / 5) * 16;
          case COMPRESSED_RGBA_ASTC_10x6_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
               return Math.floor((width + 9) / 10) * Math.floor((height + 5) / 6) * 16;
          case COMPRESSED_RGBA_ASTC_10x8_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
               return Math.floor((width + 9) / 10) * Math.floor((height + 7) / 8) * 16;
          case COMPRESSED_RGBA_ASTC_10x10_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
               return Math.floor((width + 9) / 10) * Math.floor((height + 9) / 10) * 16;
          case COMPRESSED_RGBA_ASTC_12x10_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
               return Math.floor((width + 11) / 12) * Math.floor((height + 9) / 10) * 16;
          case COMPRESSED_RGBA_ASTC_12x12_KHR:
          case COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
               return Math.floor((width + 11) / 12) * Math.floor((height + 11) / 12) * 16; 
  
          default:
              return 0;
      }
  }