diff --git a/Cargo.toml b/Cargo.toml index 8f4f3bf..c4a6326 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,9 +4,13 @@ resolver = "2" members = [ "shame_derive", "shame", + "shame_wgpu", "examples/*", ] +[workspace.dependencies] +wgpu = "25.0.0" + [profile.dev] split-debuginfo = "unpacked" diff --git a/README.md b/README.md index 4b74cee..f2cbb52 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,14 @@ Modern graphics APIs often require us filling out descriptors, matching up their cargo add --git https://github.com/raymarch/shame shame ``` 3. convert `shame`'s output (shader code and pipeline info) to your graphics API - > A [wgpu] example of this can be found at [examples/shame_wgpu/src/conversion.rs], which is used by the example applications. If you intend on targeting [wgpu] you can also use the [examples/shame_wgpu] crate directly. If you target a different API, that example can still be a useful reference. + > A [wgpu] example of this can be found at [shame_wgpu/src/conversion.rs], which is used by the example applications. If you intend on targeting [wgpu] you can also use the [shame_wgpu] crate directly. If you target a different API, that example can still be a useful reference. 4. check out the [api overview](examples/api_showcase/src/main.rs) of `shame` and have fun writing pipelines in Rust! [examples/api_showcase/src/main.rs]: examples/api_showcase/src/main.rs -[examples/shame_wgpu/src/conversion.rs]: examples/shame_wgpu/src/conversion.rs -[examples/shame_wgpu]: examples/shame_wgpu +[shame_wgpu/src/conversion.rs]: shame_wgpu/src/conversion.rs +[shame_wgpu]: shame_wgpu ## Code example (more in examples folder) diff --git a/examples/hello_triangles/Cargo.toml b/examples/hello_triangles/Cargo.toml index 19b33ad..77f59ce 100644 --- a/examples/hello_triangles/Cargo.toml +++ b/examples/hello_triangles/Cargo.toml @@ -4,9 +4,9 @@ version = "0.1.0" edition = "2024" [dependencies] -shame_wgpu = { path = "../shame_wgpu" } +shame_wgpu = { path = "../../shame_wgpu" } shame = { path = "../../shame" } -wgpu = "25.0.0" +wgpu = {workspace = true} bytemuck = { version = "1.19", features = ["derive"] } glam = { version = "0.30.2", features = ["bytemuck", "cuda"] } # "cuda" for 8-byte aligned Vec2 winit = "0.30.9" diff --git a/examples/shame_wgpu/Cargo.toml b/examples/shame_wgpu/Cargo.toml deleted file mode 100644 index a5c8279..0000000 --- a/examples/shame_wgpu/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "shame_wgpu" -version = "2.0.0-beta.0" -edition = "2024" - -[lib] -name = "shame_wgpu" -doctest = false # TODO(release) remove, and fix documentation to pass tests - -[dependencies] -shame = { path = "../../shame" } -wgpu = "25.0.0" -thiserror = "2.0.12" -concat-idents = "1.1.5" diff --git a/shame/Cargo.toml b/shame/Cargo.toml index 6d7bdb4..ab26354 100644 --- a/shame/Cargo.toml +++ b/shame/Cargo.toml @@ -27,7 +27,7 @@ shame_derive = { path = "../shame_derive/" } static_assertions = "1.1.0" pretty_assertions = "1.4.1" glam = "0.29.0" -shame_wgpu = { path = "../examples/shame_wgpu" } +shame_wgpu = { path = "../shame_wgpu" } bytemuck = { version = "1.19", features = ["derive"] } wgpu = "25.0.2" pollster = "0.4" diff --git a/shame_wgpu/Cargo.toml b/shame_wgpu/Cargo.toml new file mode 100644 index 0000000..cad12ad --- /dev/null +++ b/shame_wgpu/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "shame_wgpu" +version = "2.0.0-beta.0" +description = "wgpu integration for shame — shader metaprogramming in Rust" +keywords = ["gpu", "shader", "wgpu", "graphics", "wgsl"] +categories = ["rendering::graphics-api", "rendering::shader"] +repository = "https://github.com/RayMarch/shame" +license = "MIT OR Apache-2.0" +edition = "2024" + +[lib] +name = "shame_wgpu" +doctest = false # TODO(release) remove, and fix documentation to pass tests + +[dependencies] +shame = { path = "../shame" } +wgpu = {workspace = true} +thiserror = "2.0.12" +concat-idents = "1.1.5" diff --git a/examples/shame_wgpu/src/bind_group.rs b/shame_wgpu/src/bind_group.rs similarity index 100% rename from examples/shame_wgpu/src/bind_group.rs rename to shame_wgpu/src/bind_group.rs diff --git a/examples/shame_wgpu/src/binding.rs b/shame_wgpu/src/binding.rs similarity index 100% rename from examples/shame_wgpu/src/binding.rs rename to shame_wgpu/src/binding.rs diff --git a/examples/shame_wgpu/src/conversion.rs b/shame_wgpu/src/conversion.rs similarity index 100% rename from examples/shame_wgpu/src/conversion.rs rename to shame_wgpu/src/conversion.rs diff --git a/examples/shame_wgpu/src/lib.rs b/shame_wgpu/src/lib.rs similarity index 100% rename from examples/shame_wgpu/src/lib.rs rename to shame_wgpu/src/lib.rs diff --git a/examples/shame_wgpu/src/surface_format.rs b/shame_wgpu/src/surface_format.rs similarity index 100% rename from examples/shame_wgpu/src/surface_format.rs rename to shame_wgpu/src/surface_format.rs diff --git a/examples/shame_wgpu/src/texture_view.rs b/shame_wgpu/src/texture_view.rs similarity index 100% rename from examples/shame_wgpu/src/texture_view.rs rename to shame_wgpu/src/texture_view.rs