Skip to content

Commit

Permalink
webgl: Fix errors on some glUniform calls with memory size over 2GiB …
Browse files Browse the repository at this point in the history
…in WebGL2

In emscripten-core#21445, temporary buffers were appropriately included in
dependencies. But in the following emscripten-core#21462 they were overlooked,
resulting in errors on certain GL calls when memory size exceeded 2GiB
in WebGL2. This pull request aims to fix this issue.
  • Loading branch information
ntwbvdbl-oe committed Apr 24, 2024
1 parent 0279183 commit 2329478
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/library_webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform1iv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLIntBuffers'
#endif
],
Expand Down Expand Up @@ -2453,7 +2453,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform2iv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLIntBuffers'
#endif
],
Expand Down Expand Up @@ -2495,7 +2495,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform3iv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLIntBuffers'
#endif
],
Expand Down Expand Up @@ -2538,7 +2538,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform4iv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLIntBuffers'
#endif
],
Expand Down Expand Up @@ -2582,7 +2582,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform1fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2623,7 +2623,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform2fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2708,7 +2708,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform4fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2756,7 +2756,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniformMatrix2fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2800,7 +2800,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniformMatrix3fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down

0 comments on commit 2329478

Please sign in to comment.