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 (#21819)

In #21445, temporary buffers were appropriately included in
dependencies. But in the following #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 authored Apr 25, 2024
1 parent a506124 commit 4e7c86a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 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 == 1 || !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 == 1 || !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 == 1 || !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 == 1 || !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 == 1 || !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 == 1 || !WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2665,7 +2665,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniform3fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
#if GL_POOL_TEMP_BUFFERS && (MIN_WEBGL_VERSION == 1 || !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 == 1 || !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 == 1 || !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 == 1 || !WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down Expand Up @@ -2849,7 +2849,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
},
glUniformMatrix4fv__deps: ['$webglGetUniformLocation'
#if GL_POOL_TEMP_BUFFERS && !(MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS)
#if GL_POOL_TEMP_BUFFERS && (MIN_WEBGL_VERSION == 1 || !WEBGL_USE_GARBAGE_FREE_APIS)
, '$miniTempWebGLFloatBuffers'
#endif
],
Expand Down

0 comments on commit 4e7c86a

Please sign in to comment.