From 0479fb3f323681c4139db5dd65500059410703e0 Mon Sep 17 00:00:00 2001 From: Kirill Gavrilov Date: Fri, 21 Nov 2025 08:28:51 +0300 Subject: [PATCH] [wasm64] Fix pointer math in glTransformFeedbackVaryings() and glGetUniformIndices() --- src/lib/libwebgl2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/libwebgl2.js b/src/lib/libwebgl2.js index f9f4ca271cbf2..64166b5ce1fc2 100644 --- a/src/lib/libwebgl2.js +++ b/src/lib/libwebgl2.js @@ -386,7 +386,7 @@ var LibraryWebGL2 = { program = GL.programs[program]; var vars = []; for (var i = 0; i < count; i++) - vars.push(UTF8ToString({{{ makeGetValue('varyings', 'i*4', 'i32') }}})); + vars.push(UTF8ToString({{{ makeGetValue('varyings', 'i*' + POINTER_SIZE, '*') }}})); GLctx.transformFeedbackVaryings(program, vars, bufferMode); }, @@ -519,7 +519,7 @@ var LibraryWebGL2 = { program = GL.programs[program]; var names = []; for (var i = 0; i < uniformCount; i++) - names.push(UTF8ToString({{{ makeGetValue('uniformNames', 'i*4', 'i32') }}})); + names.push(UTF8ToString({{{ makeGetValue('uniformNames', 'i*' + POINTER_SIZE, '*') }}})); var result = GLctx.getUniformIndices(program, names); if (!result) return; // GL spec: If an error is generated, nothing is written out to uniformIndices.