From 78bfe3e744926d51091633ef605145f4399fdd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Travostino?= Date: Tue, 3 Nov 2026 10:28:39 +0100 Subject: [PATCH] webgl_triangle: fix calculation of WASM page sizes Incidentally the correct size was returned because $MAX_MEMORY_PAGES is equivalent to $PAGE_SIZE, but still, the equation was technically incorrect and potentially confusing. --- wasm/webgl/webgl_triangle/build_web.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 wasm/webgl/webgl_triangle/build_web.sh diff --git a/wasm/webgl/webgl_triangle/build_web.sh b/wasm/webgl/webgl_triangle/build_web.sh old mode 100644 new mode 100755 index 05bc07b..d36f117 --- a/wasm/webgl/webgl_triangle/build_web.sh +++ b/wasm/webgl/webgl_triangle/build_web.sh @@ -2,12 +2,13 @@ set -euxo pipefail -# NOTE: changing this requires changing the same values in the `web/index.html`. +# NOTE: changing these requires changing the same values in the `web/index.html`. INITIAL_MEMORY_PAGES=2000 MAX_MEMORY_PAGES=65536 +PAGE_SIZE=65536 -INITIAL_MEMORY_BYTES=$(expr $INITIAL_MEMORY_PAGES \* $MAX_MEMORY_PAGES) -MAX_MEMORY_BYTES=$(expr $MAX_MEMORY_PAGES \* $MAX_MEMORY_PAGES) +INITIAL_MEMORY_BYTES=$(expr $INITIAL_MEMORY_PAGES \* $PAGE_SIZE) +MAX_MEMORY_BYTES=$(expr $MAX_MEMORY_PAGES \* $PAGE_SIZE) ODIN_ROOT=$(odin root) ODIN_JS="$ODIN_ROOT/core/sys/wasm/js/odin.js"