26 lines
1.2 KiB
Diff
26 lines
1.2 KiB
Diff
diff -urN emsdk/upstream/emscripten/src/library_webgl.js emsdk-fixed/upstream/emscripten/src/library_webgl.js
|
|
--- emsdk/upstream/emscripten/src/library_webgl.js 2022-03-24 19:45:37.000000000 +0000
|
|
+++ emsdk-fixed/upstream/emscripten/src/library_webgl.js 2022-04-24 08:18:17.235609809 +0000
|
|
@@ -1782,7 +1782,9 @@
|
|
#if MAX_WEBGL_VERSION >= 2
|
|
if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
|
|
if (data) {
|
|
- GLctx.bufferData(target, HEAPU8, usage, data, size);
|
|
+ if (size > 0) {
|
|
+ GLctx.bufferData(target, HEAPU8, usage, data, size);
|
|
+ }
|
|
} else {
|
|
GLctx.bufferData(target, size, usage);
|
|
}
|
|
@@ -1800,7 +1802,9 @@
|
|
glBufferSubData: function(target, offset, size, data) {
|
|
#if MAX_WEBGL_VERSION >= 2
|
|
if ({{{ isCurrentContextWebGL2() }}}) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
|
|
- GLctx.bufferSubData(target, offset, HEAPU8, data, size);
|
|
+ if (size > 0) {
|
|
+ GLctx.bufferSubData(target, offset, HEAPU8, data, size);
|
|
+ }
|
|
return;
|
|
}
|
|
#endif
|