fix wgpu examples after move of files in 95721fe

This commit is contained in:
Laytan Laats
2024-09-29 10:38:29 +02:00
parent 90d024fb70
commit eeaa9f048b
8 changed files with 12 additions and 10 deletions

View File

@@ -8,10 +8,10 @@ PAGE_SIZE := 65536
INITIAL_MEMORY_BYTES := $(shell expr $(INITIAL_MEMORY_PAGES) \* $(PAGE_SIZE))
MAX_MEMORY_BYTES := $(shell expr $(MAX_MEMORY_PAGES) \* $(PAGE_SIZE))
web/triangle.wasm: $(FILES) ../../wgpu.js ../../../wasm/js/runtime.js
web/triangle.wasm: $(FILES) ../../wgpu.js ../../../../core/sys/wasm/js/odin.js
odin build . \
-target:js_wasm32 -out:web/triangle.wasm -o:size \
-extra-linker-flags:"--export-table --import-memory --initial-memory=$(INITIAL_MEMORY_BYTES) --max-memory=$(MAX_MEMORY_BYTES)"
cp ../../wgpu.js web/wgpu.js
cp ../../../wasm/js/runtime.js web/runtime.js
cp ../../../../core/sys/wasm/js/odin.js web/odin.js

View File

@@ -9,4 +9,4 @@ set /a MAX_MEMORY_BYTES=%MAX_MEMORY_PAGES% * %PAGE_SIZE%
call odin.exe build . -target:js_wasm32 -out:web/triangle.wasm -o:size -extra-linker-flags:"--export-table --import-memory --initial-memory=%INITIAL_MEMORY_BYTES% --max-memory=%MAX_MEMORY_BYTES%"
copy "..\..\wgpu.js" "web\wgpu.js"
copy "..\..\..\wasm\js\runtime.js" "web\runtime.js"
copy "..\..\..\..\core\sys\wasm\js\odin.js" "web\odin.js"

View File

@@ -1,7 +1,8 @@
package vendor_wgpu_example_triangle
import "core:sys/wasm/js"
import "vendor:wgpu"
import "vendor:wasm/js"
OS :: struct {
initialized: bool,

View File

@@ -8,7 +8,7 @@
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;">
<canvas id="wgpu-canvas"></canvas>
<script type="text/javascript" src="runtime.js"></script>
<script type="text/javascript" src="odin.js"></script>
<script type="text/javascript" src="wgpu.js"></script>
<script type="text/javascript">
const mem = new WebAssembly.Memory({ initial: 2000, maximum: 65536, shared: false });

View File

@@ -8,10 +8,10 @@ PAGE_SIZE := 65536
INITIAL_MEMORY_BYTES := $(shell expr $(INITIAL_MEMORY_PAGES) \* $(PAGE_SIZE))
MAX_MEMORY_BYTES := $(shell expr $(MAX_MEMORY_PAGES) \* $(PAGE_SIZE))
web/triangle.wasm: $(FILES) ../../wgpu.js ../../../wasm/js/runtime.js
web/triangle.wasm: $(FILES) ../../wgpu.js ../../../../core/sys/wasm/js/odin.js
odin build . \
-target:js_wasm32 -out:web/triangle.wasm -o:size \
-extra-linker-flags:"--export-table --import-memory --initial-memory=$(INITIAL_MEMORY_BYTES) --max-memory=$(MAX_MEMORY_BYTES)"
cp ../../wgpu.js web/wgpu.js
cp ../../../wasm/js/runtime.js web/runtime.js
cp ../../../../core/sys/wasm/js/odin.js web/odin.js

View File

@@ -9,4 +9,4 @@ set /a MAX_MEMORY_BYTES=%MAX_MEMORY_PAGES% * %PAGE_SIZE%
call odin.exe build . -target:js_wasm32 -out:web/triangle.wasm -o:size -extra-linker-flags:"--export-table --import-memory --initial-memory=%INITIAL_MEMORY_BYTES% --max-memory=%MAX_MEMORY_BYTES%"
copy "..\..\wgpu.js" "web\wgpu.js"
copy "..\..\..\wasm\js\runtime.js" "web\runtime.js"
copy "..\..\..\..\core\sys\wasm\js\odin.js" "web\odin.js"

View File

@@ -1,7 +1,8 @@
package vendor_wgpu_example_triangle
import "core:sys/wasm/js"
import "vendor:wgpu"
import "vendor:wasm/js"
OS :: struct {
initialized: bool,

View File

@@ -8,7 +8,7 @@
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;">
<canvas id="wgpu-canvas"></canvas>
<script type="text/javascript" src="runtime.js"></script>
<script type="text/javascript" src="odin.js"></script>
<script type="text/javascript" src="wgpu.js"></script>
<script type="text/javascript">
const mem = new WebAssembly.Memory({ initial: 2000, maximum: 65536, shared: false });