Skip to content

Commit 18b1d9f

Browse files
committed
Revert "Update parallel raytracing .gitignore (#3606)"
This reverts commit 792be2d.
1 parent 792be2d commit 18b1d9f

File tree

14 files changed

+48
-142
lines changed

14 files changed

+48
-142
lines changed

examples/raytrace-parallel/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
raytrace_parallel.js
2+
raytrace_parallel_bg.wasm

examples/raytrace-parallel/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ online][compiled]
99
You can build the example locally with:
1010

1111
```
12-
$ python3 run.py
12+
$ ./run.sh
1313
```
1414

15+
(or running the commands on Windows manually)
16+
1517
and then visiting http://localhost:8080 in a browser should run the example!

examples/raytrace-parallel/build.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

examples/raytrace-parallel/build.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,22 @@
22

33
set -ex
44

5-
python3 build.py
5+
# A couple of steps are necessary to get this build working which makes it slightly
6+
# nonstandard compared to most other builds.
7+
#
8+
# * First, the Rust standard library needs to be recompiled with atomics
9+
# enabled. to do that we use Cargo's unstable `-Zbuild-std` feature.
10+
#
11+
# * Next we need to compile everything with the `atomics` and `bulk-memory`
12+
# features enabled, ensuring that LLVM will generate atomic instructions,
13+
# shared memory, passive segments, etc.
14+
15+
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \
16+
cargo build --target wasm32-unknown-unknown --release -Z build-std=std,panic_abort
17+
18+
# Note the usage of `--target no-modules` here which is required for passing
19+
# the memory import to each wasm module.
20+
cargo run -p wasm-bindgen-cli -- \
21+
../../target/wasm32-unknown-unknown/release/raytrace_parallel.wasm \
22+
--out-dir . \
23+
--target no-modules

examples/raytrace-parallel/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
document.getElementById('render').disabled = true;
220220
document.getElementById('concurrency').disabled = true;
221221
</script>
222-
<script src='pkg/raytrace_parallel.js'></script>
222+
<script src='raytrace_parallel.js'></script>
223223
<script src='index.js'></script>
224224
</body>
225225
</html>

examples/raytrace-parallel/run.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/raytrace-parallel/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -ex
44

5-
python3 build.py
5+
./build.sh
66

77
python3 server.py

examples/raytrace-parallel/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// synchronously, using the browser, import out shim JS scripts
2-
importScripts('pkg/raytrace_parallel.js');
2+
importScripts('raytrace_parallel.js');
33

44
// Wait for the main thread to send us the shared module/memory. Once we've got
55
// it, initialize it all with the `wasm_bindgen` global we imported via

examples/wasm-audio-worklet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ online][compiled]
99
You can build the example locally with:
1010

1111
```
12-
$ python3 run.py
12+
$ ./run.sh
1313
```
1414

1515
(or running the commands on Windows manually)

examples/wasm-audio-worklet/build.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

examples/wasm-audio-worklet/build.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,21 @@
22

33
set -ex
44

5-
python3 build.py
5+
# A couple of steps are necessary to get this build working which makes it slightly
6+
# nonstandard compared to most other builds.
7+
#
8+
# * First, the Rust standard library needs to be recompiled with atomics
9+
# enabled. to do that we use Cargo's unstable `-Zbuild-std` feature.
10+
#
11+
# * Next we need to compile everything with the `atomics` and `bulk-memory`
12+
# features enabled, ensuring that LLVM will generate atomic instructions,
13+
# shared memory, passive segments, etc.
14+
15+
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \
16+
cargo build --target wasm32-unknown-unknown --release -Z build-std=std,panic_abort
17+
18+
cargo run -p wasm-bindgen-cli -- \
19+
../../target/wasm32-unknown-unknown/release/wasm_audio_worklet.wasm \
20+
--out-dir . \
21+
--target web \
22+
--split-linked-modules

examples/wasm-audio-worklet/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</head>
66
<body>
77
<script type="module">
8-
import init, {web_main} from "./pkg/wasm_audio_worklet.js";
8+
import init, {web_main} from "./wasm_audio_worklet.js";
99
async function run() {
1010
await init();
1111
web_main();

examples/wasm-audio-worklet/run.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/wasm-audio-worklet/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -ex
44

5-
python3 build.py
5+
./build.sh
66

77
python3 server.py

0 commit comments

Comments
 (0)