Skip to content

Commit

Permalink
Allow DataView in .bufferData() & .bufferSubData() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanSanchez authored and dhritzkiv committed Dec 22, 2022
1 parent f2fac60 commit 8511cd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/javascript/webgl-rendering-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {

if (typeof data === 'object') {
let u8Data = null
if (isTypedArray(data)) {
if (isTypedArray(data) || data instanceof DataView) {
u8Data = unpackTypedArray(data)
} else if (data instanceof ArrayBuffer) {
u8Data = new Uint8Array(data)
Expand Down Expand Up @@ -1386,7 +1386,7 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
}

let u8Data = null
if (isTypedArray(data)) {
if (isTypedArray(data) || data instanceof DataView) {
u8Data = unpackTypedArray(data)
} else if (data instanceof ArrayBuffer) {
u8Data = new Uint8Array(data)
Expand Down

0 comments on commit 8511cd7

Please sign in to comment.