Skip to content

Commit 8511cd7

Browse files
IvanSanchezdhritzkiv
authored andcommitted
Allow DataView in .bufferData() & .bufferSubData() calls
1 parent f2fac60 commit 8511cd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/javascript/webgl-rendering-context.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
13041304

13051305
if (typeof data === 'object') {
13061306
let u8Data = null
1307-
if (isTypedArray(data)) {
1307+
if (isTypedArray(data) || data instanceof DataView) {
13081308
u8Data = unpackTypedArray(data)
13091309
} else if (data instanceof ArrayBuffer) {
13101310
u8Data = new Uint8Array(data)
@@ -1386,7 +1386,7 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
13861386
}
13871387

13881388
let u8Data = null
1389-
if (isTypedArray(data)) {
1389+
if (isTypedArray(data) || data instanceof DataView) {
13901390
u8Data = unpackTypedArray(data)
13911391
} else if (data instanceof ArrayBuffer) {
13921392
u8Data = new Uint8Array(data)

0 commit comments

Comments
 (0)