Skip to content

Commit 45ae58a

Browse files
authored
deps(lambda-rs): Update to wgpu & naga to v28 and replace push constants with immediates
2 parents 78d708c + a7f678a commit 45ae58a

File tree

25 files changed

+748
-482
lines changed

25 files changed

+748
-482
lines changed

Cargo.lock

Lines changed: 110 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ resolver = "2"
33

44
# Sub packages provided by lambda.
55
members = [
6-
"crates/lambda-rs",
7-
"crates/lambda-rs-args",
8-
"crates/lambda-rs-logging",
9-
"crates/lambda-rs-platform",
10-
"tools/obj_loader"
6+
"crates/lambda-rs",
7+
"crates/lambda-rs-args",
8+
"crates/lambda-rs-logging",
9+
"crates/lambda-rs-platform",
10+
"tools/obj_loader",
1111
]
1212

1313
default-members = [
14-
"crates/lambda-rs",
15-
"crates/lambda-rs-args",
16-
"crates/lambda-rs-logging",
17-
"crates/lambda-rs-platform",
18-
"tools/obj_loader"
14+
"crates/lambda-rs",
15+
"crates/lambda-rs-args",
16+
"crates/lambda-rs-logging",
17+
"crates/lambda-rs-platform",
18+
"tools/obj_loader",
1919
]

README.md

Lines changed: 102 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
![lambda-rs](https://img.shields.io/crates/v/lambda-rs)
99

1010
## Table of contents
11+
1112
1. [Description](#description)
1213
1. [API Documentation](#documentation)
1314
1. [Building](#building)
@@ -23,13 +24,16 @@
2324
1. [Releases & Publishing](#publishing)
2425
1. [How to contribute](#contribute)
2526
1. [Resources](#resources)
27+
2628
## Description <a name="description"></a>
29+
2730
Lambda is a framework for developing cross platform applications and workloads using Rust.
2831

2932
Lambda aims to enable developers to create highly performant, portable, and
3033
minimal desktop applications by providing a platform agnostic API for all of the features that any application or workload might need.
3134

3235
Lambda :
36+
3337
* Desktop applications
3438
* Productivity tools
3539
* Data visualizations
@@ -49,11 +53,13 @@ lightweight HTML/CSS based rendering in the future but we're primarily focused
4953
on implementing a Rust native UI framework built on top of our rendering engine.
5054

5155
## Documentation <a name="documentation"></a>
56+
5257
* [lambda-rs API documentation](https://docs.rs/lambda-rs/2023.1.29/lambda/)
5358

5459
## Installation <a name="building"></a>
5560

5661
### From crates.io <a name="crates"></a>
62+
5763
lambda is now available on [crates.io](https://crates.io/crates/lambda-rs)
5864
and can be added to your project by adding the following to your
5965
`Cargo.toml` file:
@@ -64,142 +70,178 @@ lambda-rs = "2023.1.30"
6470
```
6571

6672
or from the CLI:
73+
6774
```bash
6875
cargo add lambda-rs
6976
```
7077

7178
### From source <a name="source"></a>
7279

7380
#### Required external dependencies <a name="ext_deps"></a>
81+
7482
* All platforms
75-
* `cmake >= 3.20.0` is needed to build shaderc from source.
76-
* `ninja` is needed to build shaderc from source.
77-
* `git` is needed to clone the project and manage it's dependencies.
78-
* `git-lfs` is needed for asset files.
79-
* `rust >= 1.60` is needed for compiling lambda and all of it's crates.
80-
* `pre-commit` is used for development git commit hooks and any changes that do not pass the pre-commit checks will not be accepted.
83+
* `cmake >= 3.20.0` is needed to build shaderc from source.
84+
* `ninja` is needed to build shaderc from source.
85+
* `git` is needed to clone the project and manage it's dependencies.
86+
* `git-lfs` is needed for asset files.
87+
* `rust >= 1.60` is needed for compiling lambda and all of it's crates.
88+
* `pre-commit` is used for development git commit hooks and any changes that do not pass the pre-commit checks will not be accepted.
8189

8290
#### Rendering API support
91+
8392
These are the Rendering APIs that are supported on each platform and must be
8493
installed manually. More information on how to choose which backend lambda
8594
uses on each platform is provided further below.
95+
8696
* Windows
87-
* `OpenGL`
88-
* `Vulkan`
89-
* `DirectX11`
90-
* `DirectX12`
97+
* `OpenGL`
98+
* `Vulkan`
99+
* `DirectX11`
100+
* `DirectX12`
91101
* Linux
92-
* `OpenGL`
93-
* `Vulkan`
102+
* `OpenGL`
103+
* `Vulkan`
94104
* MacOS
95-
* `Metal`
96-
* `Vulkan`
105+
* `Metal`
106+
* `Vulkan`
97107

98108
#### Linux (bash), MacOS (bash), Windows (git-bash) <a name="bash"></a>
109+
99110
If planning to develop for lambda, you must run the setup script provided by repository like so:
111+
100112
```bash
101113
./scripts/setup.sh
102114
```
115+
103116
This will initialize pre commit checks for development use and setup git-lfs for asset management.
104117

105118
In order to validate that lambda successfully compiles, you can build the library by performing a build with cargo.
119+
106120
```bash
107121
cargo build --lib
108122
```
123+
109124
If this works successfully, then lambda is ready to work on your system!
110125

111126
## Getting started <a name="get_started"></a>
127+
112128
Coming soon.
113129

114130
## Tutorials <a name="tutorials"></a>
131+
115132
Start with the tutorials to build features step by step:
116133

117-
- Tutorials index: [docs/tutorials/](./docs/tutorials/)
118-
- Uniform Buffers: Build a Spinning Triangle: [docs/tutorials/uniform-buffers.md](./docs/tutorials/uniform-buffers.md)
134+
* Tutorials index: [docs/tutorials/](./docs/tutorials/)
135+
* Uniform Buffers: Build a Spinning Triangle: [docs/tutorials/uniform-buffers.md](./docs/tutorials/uniform-buffers.md)
119136

120137
## Examples <a name="examples"></a>
138+
121139
Browse example sources:
122140

123-
- Core API examples: [crates/lambda-rs/examples/](./crates/lambda-rs/examples/)
124-
- Logging examples: [crates/lambda-rs-logging/examples/](./crates/lambda-rs-logging/examples/)
125-
- Argument parsing examples: [crates/lambda-rs-args/examples/](./crates/lambda-rs-args/examples/)
141+
* Core API examples: [crates/lambda-rs/examples/](./crates/lambda-rs/examples/)
142+
* Logging examples: [crates/lambda-rs-logging/examples/](./crates/lambda-rs-logging/examples/)
143+
* Argument parsing examples: [crates/lambda-rs-args/examples/](./crates/lambda-rs-args/examples/)
126144

127145
### Minimal
146+
128147
A minimal example of an application with a working window using lambda.
148+
129149
```rust
130150
cargo run --example minimal
131151
```
132152

133-
### Push Constants
134-
An example of using shaders with push constants to render a 3D image.
153+
### Immediates
154+
155+
An example of using shaders with immediates (per-draw data) to render a 3D image.
156+
135157
```rust
136-
cargo run --example push_constants
158+
cargo run --example immediates
137159
```
138160

139161
#### Notes
162+
140163
* On windows, you need to run this example with
141164
`--features lambda-rs/with-vulkan` as the shader used in the example does not work
142165
in either dx11 or dx12.
143166

144167
### Triangle
168+
145169
An example using shaders to render a single triangle.
170+
146171
```rust
147172
cargo run --example triangle
148173
```
149174

150175
### Triangles
176+
151177
An example using shaders to render multiple triangles and keyboard input to move one of the triangles on screen.
178+
152179
```rust
153180
cargo run --example triangles
154181
```
155182

156183
## Plans <a name="plans"></a>
157-
- ### Architecture support
158-
- [x] x86
159-
- [x] arm64
160-
- ### Operating system support
161-
- [x] MacOS
162-
- [x] Linux
163-
- [x] Windows 10/11
164-
- [ ] Xbox Series S|X (Long term goal)
165-
- [ ] iOS (Long term goal)
166-
- [ ] Android (Long term goal)
167-
- ### Rendering API support
168-
- [x] OpenGL
169-
- [x] Vulkan
170-
- [x] Metal
171-
- [x] DirectX11
172-
- [x] DirectX12
173-
- ### Packages
174-
- [x] (WIP) [lambda-rs-args](./crates/lambda-rs-args/README.md) -- Command line argument parsing.
175-
- [x] (WIP) [lambda-rs-platform](./crates/lambda-rs-platform/README.md) -- Dependency wrappers & platform support.
176-
- [x] [lambda-rs-logging](./crates/lambda-rs-logging/README.md) -- Lightweight Logging API for lambda-rs packages.
177-
- [x] (WIP) [lambda-rs](./crates/lambda-rs/README.md) -- The public Lambda API.
178-
- ### Examples
179-
- [x] Minimal -- A minimal example of an application with a working window
184+
185+
* ### Architecture support
186+
187+
* [x] x86
188+
* [x] arm64
189+
190+
* ### Operating system support
191+
192+
* [x] MacOS
193+
* [x] Linux
194+
* [x] Windows 10/11
195+
* [ ] Xbox Series S|X (Long term goal)
196+
* [ ] iOS (Long term goal)
197+
* [ ] Android (Long term goal)
198+
199+
* ### Rendering API support
200+
201+
* [x] OpenGL
202+
* [x] Vulkan
203+
* [x] Metal
204+
* [x] DirectX11
205+
* [x] DirectX12
206+
207+
* ### Packages
208+
209+
* [x] (WIP) [lambda-rs-args](./crates/lambda-rs-args/README.md) -- Command line argument parsing.
210+
* [x] (WIP) [lambda-rs-platform](./crates/lambda-rs-platform/README.md) -- Dependency wrappers & platform support.
211+
* [x] [lambda-rs-logging](./crates/lambda-rs-logging/README.md) -- Lightweight Logging API for lambda-rs packages.
212+
* [x] (WIP) [lambda-rs](./crates/lambda-rs/README.md) -- The public Lambda API.
213+
214+
* ### Examples
215+
216+
* [x] Minimal -- A minimal example of an application with a working window
180217
using lambda.
181-
- [x] Push Constants -- An example of using shaders with push constants to
218+
* [x] Immediates -- An example of using shaders with immediate data to
182219
render a 3D image.
183-
- [x] Triangle -- An example using shaders to render a single triangle.
184-
- [x] Triangles -- An example using shaders to render multiple triangles and keyboard input to move one of the triangles on screen.
185-
- ### Tools
186-
- [x] obj-loader -- (WIP) Loads .obj files into lambda. Meshes need to be triangulated in order for it to render at the moment.
187-
- [ ] platform-info -- Utility for viewing information about the current platform.
188-
- ### CI/CD
189-
- [x] Github action pipelines for building lambda on all platforms.
190-
- [ ] Github action pipelines for creating downloadable builds from releases.
191-
- [ ] Tests & benchmarking.
192-
- [ ] Unit tests.
193-
- [ ] Nightly builds.
220+
* [x] Triangle -- An example using shaders to render a single triangle.
221+
* [x] Triangles -- An example using shaders to render multiple triangles and keyboard input to move one of the triangles on screen.
222+
223+
* ### Tools
224+
225+
* [x] obj-loader -- (WIP) Loads .obj files into lambda. Meshes need to be triangulated in order for it to render at the moment.
226+
* [ ] platform-info -- Utility for viewing information about the current platform.
227+
228+
* ### CI/CD
229+
230+
* [x] Github action pipelines for building lambda on all platforms.
231+
* [ ] Github action pipelines for creating downloadable builds from releases.
232+
* [ ] Tests & benchmarking.
233+
* [ ] Unit tests.
234+
* [ ] Nightly builds.
194235

195236
## Releases & Publishing <a name="publishing"></a>
237+
196238
For cutting releases, publishing crates to crates.io, and attaching
197239
multi-platform artifacts to GitHub Releases, see:
198240

199-
- docs/publishing.md
200-
241+
* docs/publishing.md
201242

202243
## How to contribute <a name="contribute"></a>
244+
203245
Fork the current repository and then make the changes that you'd like to
204246
said fork. Stable releases will happen within the main branch requiring that
205247
additions to be made off of `dev` which is the nightly build branch for lambda.
@@ -211,6 +253,7 @@ changes made, my schedule, and any other variable factors. They must also pass
211253
all of the build pipelines are configured to run at merge.
212254

213255
## Resources <a name="resources"></a>
256+
214257
[The Cherno's playlist for making a game engine](https://www.youtube.com/playlist?list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT)
215258

216259
[Creator of Logo](https://github.com/RinniSwift)

crates/lambda-rs-platform/Cargo.toml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,47 @@ path = "src/lib.rs"
1313
[dependencies]
1414
winit = "=0.29.15"
1515
shaderc = { version = "=0.7", optional = true, default-features = false }
16-
naga = { version = "=26.0.0", optional = true, default-features = false, features = ["spv-out", "glsl-in", "wgsl-in"] }
16+
naga = { version = "=28.0.0", optional = true, default-features = false, features = [
17+
"spv-out",
18+
"glsl-in",
19+
"wgsl-in",
20+
] }
1721
rand = "=0.8.5"
1822
obj-rs = "=0.7.0"
19-
wgpu = { version = "=26.0.1", optional = true, features = ["wgsl", "spirv"] }
23+
wgpu = { version = "=28.0.0", optional = true, features = ["wgsl", "spirv"] }
2024
pollster = { version = "=0.4.0", optional = true }
2125
lambda-rs-logging = { path = "../lambda-rs-logging", version = "2023.1.30" }
2226

27+
# Force windows crate to 0.62 to unify wgpu-hal and gpu-allocator dependencies.
28+
# Both crates support this version range, but Cargo may resolve to different
29+
# versions without this explicit constraint.
30+
[target.'cfg(windows)'.dependencies]
31+
windows = "0.62"
32+
2333
[dev-dependencies]
2434
mockall = "=0.11.3"
2535

2636
[features]
27-
default=["wgpu", "shader-backend-naga"]
37+
default = ["wgpu", "shader-backend-naga"]
2838

29-
shader-backend-naga=["dep:naga"]
30-
shader-backend-shaderc=["dep:shaderc"]
31-
shader-backend-shaderc-build-from-source=["shader-backend-shaderc", "shaderc/build-from-source"]
39+
shader-backend-naga = ["dep:naga"]
40+
shader-backend-shaderc = ["dep:shaderc"]
41+
shader-backend-shaderc-build-from-source = [
42+
"shader-backend-shaderc",
43+
"shaderc/build-from-source",
44+
]
3245

33-
wgpu=["dep:wgpu", "dep:pollster", "wgpu/wgsl", "wgpu/spirv", "shader-backend-naga"]
34-
wgpu-with-vulkan=["wgpu"]
35-
wgpu-with-metal=["wgpu", "wgpu/metal"]
36-
wgpu-with-dx12=["wgpu", "wgpu/dx12"]
37-
wgpu-with-gl=["wgpu", "wgpu/webgl"]
46+
wgpu = [
47+
"dep:wgpu",
48+
"dep:pollster",
49+
"wgpu/wgsl",
50+
"wgpu/spirv",
51+
"shader-backend-naga",
52+
]
53+
wgpu-with-vulkan = ["wgpu"]
54+
wgpu-with-metal = ["wgpu", "wgpu/metal"]
55+
wgpu-with-dx12 = ["wgpu", "wgpu/dx12"]
56+
wgpu-with-gl = ["wgpu", "wgpu/webgl"]
3857

3958
[profile.dev]
4059
crate-type = ["cdylib", "rlib"]

0 commit comments

Comments
 (0)