stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.73k stars 166 forks source link

.bufferData() and .bufferSubdata() calls fails with DataView as parameter #244

Closed IvanSanchez closed 1 year ago

IvanSanchez commented 1 year ago

The documentation for the bufferSubData method states:

srcData Optional

An ArrayBuffer, SharedArrayBuffer, a DataView, or a TypedArray that will be copied into the data store.

However, the implementation does not cover DataViews:

https://github.com/stackgl/headless-gl/blob/f2fac606e42a028e19ba231b058767e1d378c1f9/src/javascript/webgl-rendering-context.js#L1307-L1314

As a consequence, any bufferData or bufferSubData calls which receive a DataView instance as parameter will fail. In turn, this is making some of my unit tests fail using headless gl but work on graphical browsers.