Skip to content

Commit

Permalink
Standalone Compute
Browse files Browse the repository at this point in the history
Fix Generate

Fix?

17th Time's The Charm

Fix Build

See Eye

Docs

Victory Tabular

Formatting

Formating3
  • Loading branch information
cwfitzgerald committed Jan 20, 2025
1 parent 5903758 commit b816249
Show file tree
Hide file tree
Showing 16 changed files with 404 additions and 455 deletions.
1 change: 1 addition & 0 deletions .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ allow = [
"Unicode-3.0",
"Zlib",
]
private = { ignore = true }

[sources]
allow-git = [
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: cargo-generate

on:
push:
branches: ["*"]
tags: [v0.*]
pull_request:
merge_group:

env:
#
# Dependency versioning
#

# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.83"
RUSTFLAGS: -D warnings

jobs:
cargo-generate:
timeout-minutes: 5

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- name: "hello-compute"
path: "examples/standalone/1_hello_compute"

name: "${{ matrix.name }}"

steps:
- uses: actions/checkout@v2

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: "Install cargo-generate"
uses: taiki-e/install-action@v2
with:
tool: cargo-generate

- name: "Run cargo-generate"
run: |
cd ..
cargo generate --path wgpu --name ${{ matrix.name }} ${{ matrix.path }}
- name: "Check generated files"
run: |
cd ../${{ matrix.name }}/
cat <<EOF >> Cargo.toml
[patch.crates-io]
wgpu = { path = "../wgpu/wgpu" }
EOF
cargo check
20 changes: 15 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
# default members
"benches",
"examples/features",
# "examples/standalone/*",
"examples/standalone/*",
"lock-analyzer",
"naga-cli",
"naga",
Expand All @@ -26,7 +26,7 @@ exclude = []
default-members = [
"benches",
"examples/features",
# "examples/standalone/*",
"examples/standalone/*",
"lock-analyzer",
"naga-cli",
"naga",
Expand Down Expand Up @@ -219,6 +219,9 @@ ndk-sys = "0.5.0"
#js-sys = { path = "../wasm-bindgen/crates/js-sys" }
#wasm-bindgen = { path = "../wasm-bindgen" }

# These overrides allow our examples to explicitly depend on release crates
wgpu = { path = "./wgpu" }

[profile.release]
lto = "thin"
debug = true
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@

The API is based on the [WebGPU standard](https://gpuweb.github.io/gpuweb/). It serves as the core of the WebGPU integration in Firefox, Servo, and Deno.

## Quick Links

| Docs | Examples | Changelog |
|:------------------------------------:|:--------------------------------------------------------------------:|:----------------------------------------------------------------------------:|
| [v24](https://docs.rs/wgpu/) | [v24](https://github.com/gfx-rs/wgpu/tree/v24/examples#readme) | [v24](https://github.com/gfx-rs/wgpu/releases) |
| [`trunk`](https://wgpu.rs/doc/wgpu/) | [`trunk`](https://github.com/gfx-rs/wgpu/tree/trunk/examples#readme) | [`trunk`](https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#unreleased) |

## Repo Overview

The repository hosts the following libraries:
Expand Down Expand Up @@ -42,14 +49,12 @@ Go to [https://wgpu.rs/examples/] to play with our examples in your browser. Req

Rust examples can be found at [wgpu/examples](examples). You can run the examples on native with `cargo run --bin wgpu-examples <example>`. See the [list of examples](examples).

If you are new to wgpu and graphics programming, we recommend starting with https://sotrh.github.io/learn-wgpu/.

To run the examples in a browser, run `cargo xtask run-wasm`.
Then open `http://localhost:8000` in your browser, and you can choose an example to run.
Naturally, in order to display any of the WebGPU based examples, you need to make sure your browser supports it.

If you are looking for a wgpu tutorial, look at the following:

- https://sotrh.github.io/learn-wgpu/

### C/C++

To use wgpu in C/C++, you need [wgpu-native](https://github.com/gfx-rs/wgpu-native).
Expand Down
Loading

0 comments on commit b816249

Please sign in to comment.