@luma.gl/webgl 9.2.2 → 9.2.4
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.
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +13 -3
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/webgl-adapter.js +2 -2
- package/dist/adapter/webgl-adapter.js.map +1 -1
- package/dist/dist.dev.js +14 -2
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +2 -2
- package/package.json +3 -3
- package/src/adapter/resources/webgl-texture.ts +17 -3
package/dist/index.cjs
CHANGED
|
@@ -2676,9 +2676,19 @@ var init_webgl_texture = __esm({
|
|
|
2676
2676
|
const { width, height, depth } = this;
|
|
2677
2677
|
const { mipLevel = 0, byteOffset = 0, x = 0, y = 0, z = 0 } = options;
|
|
2678
2678
|
const { glFormat, glType, compressed } = this;
|
|
2679
|
-
const glTarget = getWebGLCubeFaceTarget(this.glTarget, this.dimension,
|
|
2679
|
+
const glTarget = getWebGLCubeFaceTarget(this.glTarget, this.dimension, z);
|
|
2680
|
+
let unpackRowLength;
|
|
2681
|
+
if (!this.compressed) {
|
|
2682
|
+
const { bytesPerPixel } = this.device.getTextureFormatInfo(this.format);
|
|
2683
|
+
if (bytesPerPixel) {
|
|
2684
|
+
if (options.bytesPerRow % bytesPerPixel !== 0) {
|
|
2685
|
+
throw new Error(`bytesPerRow (${options.bytesPerRow}) must be a multiple of bytesPerPixel (${bytesPerPixel}) for ${this.format}`);
|
|
2686
|
+
}
|
|
2687
|
+
unpackRowLength = options.bytesPerRow / bytesPerPixel;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2680
2690
|
const glParameters = !this.compressed ? {
|
|
2681
|
-
[3314]:
|
|
2691
|
+
...unpackRowLength !== void 0 ? { [3314]: unpackRowLength } : {},
|
|
2682
2692
|
[32878]: options.rowsPerImage
|
|
2683
2693
|
} : {};
|
|
2684
2694
|
this.gl.bindTexture(glTarget, this.handle);
|