这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-14]
os: [windows-latest, macos-latest]
rust-toolchain:
- nightly

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-14]
os: [windows-latest, macos-latest]
rust-toolchain:
- nightly

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: deploy github pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1


jobs:
deploy:
runs-on: macos-latest

steps:
- name: checkout repository
uses: actions/checkout@v3

- name: setup nightly rust toolchain with caching
uses: brndnmtthws/rust-action@v1
with:
toolchain: nightly
components: rustfmt, clippy
enable-sccache: "false"

- name: install wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown

- name: install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli

# - name: install wasm-opt
# run: cargo install wasm-opt --locked

- name: build wasm artifacts
run: cargo build -p bevy_burn_dino --target wasm32-unknown-unknown --release --no-default-features --features "web"

# - name: optimize wasm artifacts
# run: wasm-opt -O -ol 100 -s 100 -o ./target/wasm32-unknown-unknown/release/bevy_burn_dino_opt.wasm ./target/wasm32-unknown-unknown/release/bevy_burn_dino.wasm

- name: generate bindings with wasm-bindgen
run: wasm-bindgen --out-dir ./crates/bevy_burn_dino/www/out/ --target web ./target/wasm32-unknown-unknown/release/bevy_burn_dino.wasm

- name: copy assets
run: mkdir -p ./crates/bevy_burn_dino/www/assets && cp -r ./crates/bevy_burn_dino/assets/* ./crates/bevy_burn_dino/www/assets/

- name: deploy to github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./www
branch: www
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-14]
os: [windows-latest, macos-latest]
rust-toolchain:
- nightly

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Cargo.lock
screenshots/
headless_output/
www/assets/
crates/bevy_burn_dino/www/assets/

assets/images/
assets/models/
Expand Down
46 changes: 37 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ resolver = "2"

[features]
default = ["import"]

benchmark = ["burn/autotune", "burn/fusion"]
import = ["bevy_args", "burn-import", "clap", "serde"]


Expand All @@ -50,19 +52,41 @@ serde = { version = "1.0", optional = true }

[dependencies.burn]
version = "0.15"
default-features = false
features = [
"autodiff",
"autotune",
"dataset",
"fusion",
"metrics",
"ndarray",
"network",
"train",
"tui",
# "autotune",
# "fusion",
"std",
"wgpu",
]

[dependencies.burn-wgpu]
version = "0.15"
default-features = false
features = [
"fusion",
"std",
# "template",
]

[dependencies.cubecl]
version = "0.3"
default-features = false
features = [
"linalg",
"std",
# "template",
]

[dependencies.cubecl-runtime]
version = "0.3"
default-features = false
features = [
"std",
"channel-mpsc",
# "template",
]


[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
Expand Down Expand Up @@ -98,15 +122,19 @@ opt-level = 3
opt-level = 1

[profile.release]
strip = "symbols"
lto = "thin"
codegen-units = 1
opt-level = 3
panic = "abort"

[profile.wasm-release]
strip = "symbols"
inherits = "release"
opt-level = "z"
lto = "fat"
codegen-units = 1
panic = "abort"


[lib]
Expand Down
18 changes: 13 additions & 5 deletions crates/bevy_burn_dino/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ categories = [
[features]
default = ["native"]

native = ["nokhwa"]
native = ["burn/autotune", "futures", "nokhwa"]
web = []

editor = []
Expand All @@ -29,8 +29,9 @@ perftest = []
[dependencies]
# bevy_args = "1.6"
bevy_args = { git = "https://github.com/mosure/bevy_args.git", branch = "burn" }
burn_dino = { path = "../../" }
burn_dino = { path = "../../", default-features = false }
clap = { version = "4.5", features = ["derive"] }
futures = { version = "0.3", optional = true }
futures-intrusive = "0.5"
image = { version = "0.25.2", default-features = false, features = ["png"] }
nokhwa = { version = "0.10", features = ["input-native", "output-threaded"], optional = true }
Expand All @@ -51,22 +52,29 @@ features = [
"bevy_text",
"bevy_ui",
"bevy_winit",
"custom_cursor",
"default_font",
"png",
# "webgpu",
"x11",
]

[dependencies.burn]
version = "0.15"
default-features = false
features = [
"autotune",
"fusion",
# "autotune",
# "fusion",
"std",
# "template",
"wgpu",
]


[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"


[dependencies.web-sys]
Expand All @@ -82,5 +90,5 @@ features = [


[[bin]]
name = "ui"
name = "bevy_burn_dino"
path = "src/main.rs"
Loading