@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/webgl",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.4",
|
|
4
4
|
"description": "WebGL2 adapter for the luma.gl core API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@luma.gl/core": "~9.2.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@luma.gl/constants": "9.2.
|
|
46
|
+
"@luma.gl/constants": "9.2.4",
|
|
47
47
|
"@math.gl/types": "^4.1.0",
|
|
48
48
|
"@probe.gl/env": "^4.0.8"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "b79327df108eb0febd307cc73b8f7196c383114e"
|
|
51
51
|
}
|
|
@@ -145,12 +145,26 @@ export class WEBGLTexture extends Texture {
|
|
|
145
145
|
const {width, height, depth} = this;
|
|
146
146
|
const {mipLevel = 0, byteOffset = 0, x = 0, y = 0, z = 0} = options;
|
|
147
147
|
const {glFormat, glType, compressed} = this;
|
|
148
|
-
const glTarget = getWebGLCubeFaceTarget(this.glTarget, this.dimension, depth);
|
|
149
148
|
|
|
150
|
-
//
|
|
149
|
+
// Target used for face updates, but not for binding
|
|
150
|
+
const glTarget = getWebGLCubeFaceTarget(this.glTarget, this.dimension, z);
|
|
151
|
+
|
|
152
|
+
let unpackRowLength: number | undefined;
|
|
153
|
+
if (!this.compressed) {
|
|
154
|
+
const {bytesPerPixel} = this.device.getTextureFormatInfo(this.format);
|
|
155
|
+
if (bytesPerPixel) {
|
|
156
|
+
if (options.bytesPerRow % bytesPerPixel !== 0) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`bytesPerRow (${options.bytesPerRow}) must be a multiple of bytesPerPixel (${bytesPerPixel}) for ${this.format}`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
unpackRowLength = options.bytesPerRow / bytesPerPixel;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
151
165
|
const glParameters: GLValueParameters = !this.compressed
|
|
152
166
|
? {
|
|
153
|
-
[GL.UNPACK_ROW_LENGTH]:
|
|
167
|
+
...(unpackRowLength !== undefined ? {[GL.UNPACK_ROW_LENGTH]: unpackRowLength} : {}),
|
|
154
168
|
[GL.UNPACK_IMAGE_HEIGHT]: options.rowsPerImage
|
|
155
169
|
}
|
|
156
170
|
: {};
|