From 08e89f12a517cd4c4ebc825e600cdf0f4a812bcb Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 17:18:00 +0200 Subject: [PATCH 1/6] move spirv-tools into a subdirectory --- Cargo.lock | 249 +++++++++++++++++- Cargo.toml | 42 +-- examples/assembler/Cargo.toml | 5 +- spirv-tools-sys/Cargo.toml | 19 +- CHANGELOG.md => spirv-tools/CHANGELOG.md | 0 spirv-tools/Cargo.toml | 43 +++ README.md => spirv-tools/README.md | 5 +- {src => spirv-tools/src}/assembler.rs | 0 .../src}/assembler/compiled.rs | 0 {src => spirv-tools/src}/assembler/tool.rs | 0 {src => spirv-tools/src}/binary.rs | 0 {src => spirv-tools/src}/cmd.rs | 0 {src => spirv-tools/src}/error.rs | 0 {src => spirv-tools/src}/lib.rs | 0 {src => spirv-tools/src}/opt.rs | 0 {src => spirv-tools/src}/opt/compiled.rs | 0 {src => spirv-tools/src}/opt/tool.rs | 0 {src => spirv-tools/src}/val.rs | 0 {src => spirv-tools/src}/val/compiled.rs | 0 {src => spirv-tools/src}/val/tool.rs | 0 .../tests}/assembled_content.spv | Bin {tests => spirv-tools/tests}/assembler.rs | 0 {tests => spirv-tools/tests}/issue_22.rs | 0 {tests => spirv-tools/tests}/optimizer.rs | 0 {tests => spirv-tools/tests}/test_content.txt | 0 {tests => spirv-tools/tests}/val.rs | 0 .../tests}/wgpu_example_shader.spv | Bin 27 files changed, 312 insertions(+), 51 deletions(-) rename CHANGELOG.md => spirv-tools/CHANGELOG.md (100%) create mode 100644 spirv-tools/Cargo.toml rename README.md => spirv-tools/README.md (85%) rename {src => spirv-tools/src}/assembler.rs (100%) rename {src => spirv-tools/src}/assembler/compiled.rs (100%) rename {src => spirv-tools/src}/assembler/tool.rs (100%) rename {src => spirv-tools/src}/binary.rs (100%) rename {src => spirv-tools/src}/cmd.rs (100%) rename {src => spirv-tools/src}/error.rs (100%) rename {src => spirv-tools/src}/lib.rs (100%) rename {src => spirv-tools/src}/opt.rs (100%) rename {src => spirv-tools/src}/opt/compiled.rs (100%) rename {src => spirv-tools/src}/opt/tool.rs (100%) rename {src => spirv-tools/src}/val.rs (100%) rename {src => spirv-tools/src}/val/compiled.rs (100%) rename {src => spirv-tools/src}/val/tool.rs (100%) rename {tests => spirv-tools/tests}/assembled_content.spv (100%) rename {tests => spirv-tools/tests}/assembler.rs (100%) rename {tests => spirv-tools/tests}/issue_22.rs (100%) rename {tests => spirv-tools/tests}/optimizer.rs (100%) rename {tests => spirv-tools/tests}/test_content.txt (100%) rename {tests => spirv-tools/tests}/val.rs (100%) rename {tests => spirv-tools/tests}/wgpu_example_shader.spv (100%) diff --git a/Cargo.lock b/Cargo.lock index ca6a1a5..7e74073 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,64 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anstream" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "assembler" +version = "0.1.0" +dependencies = [ + "clap", + "spirv-tools", +] + [[package]] name = "bitflags" version = "2.9.4" @@ -26,6 +84,52 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +[[package]] +name = "clap" +version = "4.5.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "errno" version = "0.3.14" @@ -33,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.61.1", ] [[package]] @@ -64,6 +168,18 @@ dependencies = [ "wasi", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "jobserver" version = "0.1.34" @@ -98,6 +214,30 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +dependencies = [ + "proc-macro2", +] + [[package]] name = "r-efi" version = "5.3.0" @@ -114,7 +254,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.61.1", ] [[package]] @@ -146,6 +286,23 @@ dependencies = [ "cc", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tempfile" version = "3.23.0" @@ -156,9 +313,21 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys", + "windows-sys 0.61.1", ] +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "wasi" version = "0.14.7+wasi-0.2.4" @@ -183,6 +352,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.61.1" @@ -192,6 +370,71 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.53.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "wit-bindgen" version = "0.46.0" diff --git a/Cargo.toml b/Cargo.toml index 64dab28..bc0a1ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,50 +1,24 @@ [workspace] members = [ + "spirv-tools", "spirv-tools-sys", + "examples/assembler", "tools/generate", ] +resolver = "2" -[package] -name = "spirv-tools" +[workspace.package] description = "Wrapper crate for SPIRV-Tools" repository = "https://github.com/rust-gpu/spirv-tools-rs" version = "0.12.2" -authors = ["Embark "] +authors = ["rust-gpu developers", "Embark "] edition = "2024" license = "MIT OR Apache-2.0" -readme = "README.md" documentation = "https://docs.rs/spirv-tools" homepage = "https://github.com/rust-gpu/spirv-tools-rs" keywords = ["spir-v", "rust-gpu"] categories = ["rendering::data-formats"] -exclude = [".github", "release.toml"] -[features] -default = ["use-compiled-tools"] -use-installed-tools = [ - "spirv-tools-sys/use-installed-tools", - "memchr", - "tempfile", -] -use-compiled-tools = ["spirv-tools-sys/use-compiled-tools"] - -[dependencies] -spirv-tools-sys = { version = "0.12", path = "./spirv-tools-sys", default-features = false } -# Used for parsing output when running binaries -memchr = { version = "2.3", optional = true } -tempfile = { version = "3.1", optional = true } - -[dev-dependencies] -similar = "2.0" - -[[test]] -name = "optimizer" -required-features = ["use-compiled-tools", "use-installed-tools"] - -[[test]] -name = "assembler" -required-features = ["use-compiled-tools", "use-installed-tools"] - -[[test]] -name = "issue_22" -required-features = ["use-compiled-tools", "use-installed-tools"] +[workspace.dependencies] +spirv-tools = { path = "spirv-tools", default-features = false } +spirv-tools-sys = { path = "spirv-tools-sys", default-features = false } diff --git a/examples/assembler/Cargo.toml b/examples/assembler/Cargo.toml index 8b782ec..d24a0e8 100644 --- a/examples/assembler/Cargo.toml +++ b/examples/assembler/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "assembler" version = "0.1.0" -edition = "2021" +edition.workspace = true +publish = false [dependencies] clap = { version = "4.4", features = ["derive"] } -spirv-tools = { path = "../../", features = ["use-compiled-tools"] } +spirv-tools = { workspace = true, features = ["use-compiled-tools"] } diff --git a/spirv-tools-sys/Cargo.toml b/spirv-tools-sys/Cargo.toml index 40f4e2f..4b0fd30 100644 --- a/spirv-tools-sys/Cargo.toml +++ b/spirv-tools-sys/Cargo.toml @@ -1,17 +1,18 @@ [package] name = "spirv-tools-sys" -description = "Wrapper crate for SPIRV-Tools" -repository = "https://github.com/rust-gpu/spirv-tools-rs" -version = "0.12.2" -authors = ["Embark "] -edition = "2024" +description.workspace = true +repository.workspace = true +version.workspace = true +authors.workspace = true +edition.workspace = true # This is the same license for the underlying SPIRV-Tools code license = "Apache-2.0" -documentation = "https://docs.rs/spirv-tools-sys" readme = "README.md" -homepage = "https://github.com/rust-gpu/spirv-tools-rs" -keywords = ["spir-v", "rust-gpu"] -categories = ["rendering::data-formats"] +documentation.workspace = true +homepage.workspace = true +keywords.workspace = true +categories.workspace = true + build = "build.rs" links = "spirv-tools" include = [ diff --git a/CHANGELOG.md b/spirv-tools/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to spirv-tools/CHANGELOG.md diff --git a/spirv-tools/Cargo.toml b/spirv-tools/Cargo.toml new file mode 100644 index 0000000..deafdef --- /dev/null +++ b/spirv-tools/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "spirv-tools" +description.workspace = true +repository.workspace = true +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +documentation.workspace = true +readme = "./README.md" +homepage.workspace = true +keywords.workspace = true +categories.workspace = true + +[features] +default = ["use-compiled-tools"] +use-installed-tools = [ + "spirv-tools-sys/use-installed-tools", + "memchr", + "tempfile", +] +use-compiled-tools = ["spirv-tools-sys/use-compiled-tools"] + +[dependencies] +spirv-tools-sys = { workspace = true, default-features = false } +# Used for parsing output when running binaries +memchr = { version = "2.3", optional = true } +tempfile = { version = "3.1", optional = true } + +[dev-dependencies] +similar = "2.0" + +[[test]] +name = "optimizer" +required-features = ["use-compiled-tools", "use-installed-tools"] + +[[test]] +name = "assembler" +required-features = ["use-compiled-tools", "use-installed-tools"] + +[[test]] +name = "issue_22" +required-features = ["use-compiled-tools", "use-installed-tools"] diff --git a/README.md b/spirv-tools/README.md similarity index 85% rename from README.md rename to spirv-tools/README.md index fe80bd5..cfcc3c5 100644 --- a/README.md +++ b/spirv-tools/README.md @@ -2,7 +2,7 @@ # `🛠 spirv-tools` -**Unofficial wrapper for [SPIR-V Tools], primarily for the [rust-gpu] project** +This crate is an unofficial wrapper for [SPIR-V Tools], its primary use case is for the [rust-gpu] project. [![Crates.io](https://img.shields.io/crates/v/spirv-tools.svg)](https://crates.io/crates/spirv-tools) [![Docs](https://docs.rs/spirv-tools/badge.svg)](https://docs.rs/spirv-tools) @@ -16,8 +16,7 @@ This is a very rough wrapper around the assembler, validator, and (most of the) ## Contributing -[![Contributor -Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](CODE_OF_CONDUCT.md) +[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](../CODE_OF_CONDUCT.md) We welcome community contributions to this project. diff --git a/src/assembler.rs b/spirv-tools/src/assembler.rs similarity index 100% rename from src/assembler.rs rename to spirv-tools/src/assembler.rs diff --git a/src/assembler/compiled.rs b/spirv-tools/src/assembler/compiled.rs similarity index 100% rename from src/assembler/compiled.rs rename to spirv-tools/src/assembler/compiled.rs diff --git a/src/assembler/tool.rs b/spirv-tools/src/assembler/tool.rs similarity index 100% rename from src/assembler/tool.rs rename to spirv-tools/src/assembler/tool.rs diff --git a/src/binary.rs b/spirv-tools/src/binary.rs similarity index 100% rename from src/binary.rs rename to spirv-tools/src/binary.rs diff --git a/src/cmd.rs b/spirv-tools/src/cmd.rs similarity index 100% rename from src/cmd.rs rename to spirv-tools/src/cmd.rs diff --git a/src/error.rs b/spirv-tools/src/error.rs similarity index 100% rename from src/error.rs rename to spirv-tools/src/error.rs diff --git a/src/lib.rs b/spirv-tools/src/lib.rs similarity index 100% rename from src/lib.rs rename to spirv-tools/src/lib.rs diff --git a/src/opt.rs b/spirv-tools/src/opt.rs similarity index 100% rename from src/opt.rs rename to spirv-tools/src/opt.rs diff --git a/src/opt/compiled.rs b/spirv-tools/src/opt/compiled.rs similarity index 100% rename from src/opt/compiled.rs rename to spirv-tools/src/opt/compiled.rs diff --git a/src/opt/tool.rs b/spirv-tools/src/opt/tool.rs similarity index 100% rename from src/opt/tool.rs rename to spirv-tools/src/opt/tool.rs diff --git a/src/val.rs b/spirv-tools/src/val.rs similarity index 100% rename from src/val.rs rename to spirv-tools/src/val.rs diff --git a/src/val/compiled.rs b/spirv-tools/src/val/compiled.rs similarity index 100% rename from src/val/compiled.rs rename to spirv-tools/src/val/compiled.rs diff --git a/src/val/tool.rs b/spirv-tools/src/val/tool.rs similarity index 100% rename from src/val/tool.rs rename to spirv-tools/src/val/tool.rs diff --git a/tests/assembled_content.spv b/spirv-tools/tests/assembled_content.spv similarity index 100% rename from tests/assembled_content.spv rename to spirv-tools/tests/assembled_content.spv diff --git a/tests/assembler.rs b/spirv-tools/tests/assembler.rs similarity index 100% rename from tests/assembler.rs rename to spirv-tools/tests/assembler.rs diff --git a/tests/issue_22.rs b/spirv-tools/tests/issue_22.rs similarity index 100% rename from tests/issue_22.rs rename to spirv-tools/tests/issue_22.rs diff --git a/tests/optimizer.rs b/spirv-tools/tests/optimizer.rs similarity index 100% rename from tests/optimizer.rs rename to spirv-tools/tests/optimizer.rs diff --git a/tests/test_content.txt b/spirv-tools/tests/test_content.txt similarity index 100% rename from tests/test_content.txt rename to spirv-tools/tests/test_content.txt diff --git a/tests/val.rs b/spirv-tools/tests/val.rs similarity index 100% rename from tests/val.rs rename to spirv-tools/tests/val.rs diff --git a/tests/wgpu_example_shader.spv b/spirv-tools/tests/wgpu_example_shader.spv similarity index 100% rename from tests/wgpu_example_shader.spv rename to spirv-tools/tests/wgpu_example_shader.spv From fdf04ce84fe56aa916b0e20b4f63eb5eeefec340 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 18:20:56 +0200 Subject: [PATCH 2/6] copy the readme of spirv-tools --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..cfcc3c5 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +
+ +# `🛠 spirv-tools` + +This crate is an unofficial wrapper for [SPIR-V Tools], its primary use case is for the [rust-gpu] project. + +[![Crates.io](https://img.shields.io/crates/v/spirv-tools.svg)](https://crates.io/crates/spirv-tools) +[![Docs](https://docs.rs/spirv-tools/badge.svg)](https://docs.rs/spirv-tools) +[![Build status](https://github.com/rust-gpu/spirv-tools-rs/workflows/CI/badge.svg)](https://github.com/rust-gpu/spirv-tools-rs/actions) + +
+ +## Status + +This is a very rough wrapper around the assembler, validator, and (most of the) optimizer tools available from [SPIR-V Tools], which is enough for the current needs of the [rust-gpu] project. See that project's code for more thorough usage examples. + +## Contributing + +[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](../CODE_OF_CONDUCT.md) + +We welcome community contributions to this project. + +## License + +Licensed under either of + +- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or ) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. + +[SPIR-V Tools]: https://github.com/KhronosGroup/SPIRV-Tools +[rust-gpu]: https://github.com/rust-gpu/rust-gpu From 75482dd04d19906746727f0828a129dcd3612217 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 19:02:33 +0200 Subject: [PATCH 3/6] fix cargo deny --- deny.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index bd8ee24..505bbfa 100644 --- a/deny.toml +++ b/deny.toml @@ -1,6 +1,6 @@ [graph] all-features = true -exclude = ["generate"] +exclude = ["generate", "assembler"] [licenses] allow = [ From 1ba0af346bd351ad8efd05044c2557c82cd595c6 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 19:04:26 +0200 Subject: [PATCH 4/6] write changelog --- spirv-tools/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spirv-tools/CHANGELOG.md b/spirv-tools/CHANGELOG.md index 8a5e09e..5fc9c52 100644 --- a/spirv-tools/CHANGELOG.md +++ b/spirv-tools/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +- [PR#19](https://github.com/Rust-GPU/spirv-tools-rs/pull/19) update to vulkan-sdk-1.4.321 +- [PR#20](https://github.com/Rust-GPU/spirv-tools-rs/pull/20) upgrade to edition 2024, remove webgpu target + ## [0.12.2] - 2025-08-28 - [PR#18](https://github.com/Rust-GPU/spirv-tools-rs/pull/18) disable `array-bounds` and `stringop-overflow` warnings on gnu compilers From 64800b037e03469a454173b468abf665a1b3988a Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 18:29:23 +0200 Subject: [PATCH 5/6] automate release --- Cargo.toml | 4 ++-- examples/assembler/Cargo.toml | 3 +++ release.toml | 7 ++++++- tools/generate/Cargo.toml | 5 ++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bc0a1ba..3339e0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,5 +20,5 @@ keywords = ["spir-v", "rust-gpu"] categories = ["rendering::data-formats"] [workspace.dependencies] -spirv-tools = { path = "spirv-tools", default-features = false } -spirv-tools-sys = { path = "spirv-tools-sys", default-features = false } +spirv-tools = { path = "spirv-tools", version = "0.12.2", default-features = false } +spirv-tools-sys = { path = "spirv-tools-sys", version = "0.12.2", default-features = false } diff --git a/examples/assembler/Cargo.toml b/examples/assembler/Cargo.toml index d24a0e8..ac925ac 100644 --- a/examples/assembler/Cargo.toml +++ b/examples/assembler/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" edition.workspace = true publish = false +[package.metadata.release] +release = false + [dependencies] clap = { version = "4.4", features = ["derive"] } spirv-tools = { workspace = true, features = ["use-compiled-tools"] } diff --git a/release.toml b/release.toml index 31efbb5..18dba89 100644 --- a/release.toml +++ b/release.toml @@ -1,5 +1,10 @@ -pre-release-commit-message = "Release" +# You should just need to run this to do a release of both crates: +# $ cargo release + +pre-release-commit-message = "Release {{version}}" tag-message = "Release `{{crate_name}}` {{version}}" +allow-branch = ["main"] +shared-version = true pre-release-replacements = [ { file = "CHANGELOG.md", search = "Unreleased", replace = "{{version}}" }, { file = "CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}" }, diff --git a/tools/generate/Cargo.toml b/tools/generate/Cargo.toml index 40f949d..4483738 100644 --- a/tools/generate/Cargo.toml +++ b/tools/generate/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "generate" version = "0.1.0" -edition = "2021" +edition.workspace = true publish = false +[package.metadata.release] +release = false + [[bin]] name = "generate" path = "main.rs" From 792ee0775e4da22082b0d9fa5524c17f283e2c58 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 2 Oct 2025 19:19:47 +0200 Subject: [PATCH 6/6] ci: fix publish --- .github/workflows/rust-ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 7d5af41..cfcfbbe 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -62,7 +62,6 @@ jobs: - name: cargo test run: cargo test --release --all-features - # Remove this check if you don't use cargo-deny in the repo deny-check: name: cargo-deny runs-on: ubuntu-22.04 @@ -72,7 +71,6 @@ jobs: submodules: true - uses: EmbarkStudios/cargo-deny-action@v2 - # Remove this check if you don't publish the crate(s) from this repo publish-check: name: Publish Check runs-on: ubuntu-22.04 @@ -80,11 +78,16 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - run: cargo fetch - - name: cargo publish check - run: cargo publish --dry-run --manifest-path spirv-tools-sys/Cargo.toml - - name: cargo publish check - run: cargo publish --dry-run --manifest-path Cargo.toml + - uses: cargo-bins/cargo-binstall@main + - run: cargo binstall cargo-release + - run: cargo fetch --locked + - name: cargo release --workspace + run: cargo release patch --allow-branch=* + # cargo release in workspace root doesn't actually run `publish check` on any crate, do so manually + - name: cargo publish check spirv-tools-sys + run: cargo release patch --allow-branch=* --manifest-path spirv-tools-sys/Cargo.toml + - name: cargo publish check spirv-tools + run: cargo release patch --allow-branch=* --manifest-path spirv-tools/Cargo.toml defaults: run: