@babylonjs/core 8.27.1 → 8.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2746,7 +2746,17 @@ export class ThinEngine extends AbstractEngine {
2746
2746
  break;
2747
2747
  }
2748
2748
  }
2749
- this._gl.compressedTexImage2D(target, lod, internalFormat, width, height, 0, data);
2749
+ if (texture.generateMipMaps) {
2750
+ const webGLHardwareTexture = texture._hardwareTexture;
2751
+ if (!webGLHardwareTexture.memoryAllocated) {
2752
+ gl.texStorage2D(gl.TEXTURE_2D, Math.floor(Math.log2(Math.max(width, height))) + 1, internalFormat, texture.width, texture.height);
2753
+ webGLHardwareTexture.memoryAllocated = true;
2754
+ }
2755
+ this._gl.compressedTexSubImage2D(target, lod, 0, 0, width, height, internalFormat, data);
2756
+ }
2757
+ else {
2758
+ this._gl.compressedTexImage2D(target, lod, internalFormat, width, height, 0, data);
2759
+ }
2750
2760
  }
2751
2761
  /**
2752
2762
  * @internal