diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8f73737511..0749416a57 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @eddyb \ No newline at end of file +* @eddyb @LegNeato @fornwall diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index c41ca5ca71..4891ff9e3d 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -6,9 +6,8 @@ labels: "t: enhancement" --- - -# Proposal - diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b2f7aa1bca..5f02a3d83c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. @@ -22,17 +22,17 @@ community include: * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community +* Focusing on what is best not just for us as individuals, but for the overall + community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or - advances of any kind +* The use of sexualized language or imagery, and sexual attention or advances of + any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission +* Publishing others' private information, such as a physical or email address, + without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting @@ -52,7 +52,7 @@ decisions when appropriate. This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, +Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. @@ -81,15 +81,15 @@ behavior was inappropriate. A public apology may be requested. ### 2. Warning -**Community Impact**: A violation through a single incident or series -of actions. +**Community Impact**: A violation through a single incident or series of +actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. +like social media. Violating these terms may lead to a temporary or permanent +ban. ### 3. Temporary Ban @@ -105,27 +105,27 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within -the community. +**Consequence**: A permanent ban from any sort of public interaction within the +community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. -Community Impact Guidelines were inspired by +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available -at [https://www.contributor-covenant.org/translations][translations]. +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org -[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ca083fdef..5e3e3203b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,54 +33,8 @@ If you're ready to contribute, start by looking at our open issues tagged as [`h You can comment on the issue to let others know you're interested in working on it or to ask questions. -### Major Change Process - -Most bug fixes can be implemented directly by opening a PR, however for larger design decisions and major changes to the compiler's architecture, this repository uses a two stage "Major Change Proposal" and "Request For Comments" process. If you're unsure about what's required for a specific change you should always start with [**opening an issue**][open-issue]. - [open-issue]: https://github.com/rust-gpu/rust-gpu/issues/new -#### Definitions - -##### **Major Change Proposal (MCP)** - -A proposal to make a significant internal changes or small public facing changes to the compiler. An MCP is opened as an issue on `rust-gpu` the repository. An MCP typically only requires one member's approval. Though if the change is significantly big enough it may require the full team's sign off or require an RFC. - -An MCP should generally be a short (1-2 paragraphs) high level overview of the change you would want to make, the motivation behind the change, and potential solutions. There is a [major change issue template][mcp-template] you can use for convenience. - -[mcp-template]: https://github.com/rust-lang/rust/issues/new?labels=mcp%3A%20proposed&template=mcp.md - -Examples of what would require an MCP: - -- Changing the compiler architecture. -- Adding support for an existing Rust language or feature. -- Small additions (e.g. new methods) to `spirv-std` types. -- Proposing an RFC. - -Examples of what would **not** require an MCP: - -- Updating documentation -- Fixing existing bugs -- Performance improvements - -##### **Request For Comments (RFC)** - -A proposal to make significant public facing changes to the compiler or standard library. RFCs are opened as pull requests to the `rust-gpu` repository. RFCs require full sign off by the team, before being approved or implemented. Check out the [RFC `000-template.md` document][rfc-template] for details on the structure. - -[rfc-template]: https://github.com/rust-gpu/rust-gpu/blob/main/rfcs/000-template.md - -Examples of what would require an RFC: - -- Major additions to `spirv-std`, such as new APIs, or breaking changes to existing ones. - -#### Life-cycle - -1. You file a [major change proposal][mcp-template] outlining the changes and the motivation for it. -2. A member of the team will review the proposal and tag it with the appropriate label. - 2.1. `mcp: accepted` means that the MCP has been accepted and is ready for a pull request implementing it. - 2.2. `mcp: rfc needed` means that the MCP has been accepted as something the team would like but needs a full RFC before the implementation. - 2.3 Closing an issue means that the MCP has rejected. -3. If the proposal has been accepted then the implementation can begin. - ### Pull Request Process 1. Fork the repository. diff --git a/Cargo.toml b/Cargo.toml index a8cf499f3c..0a0064a5fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,14 @@ members = [ "examples/shaders/compute-shader", "examples/shaders/mouse-shader", "examples/multibuilder", + "crates/rustc_codegen_spirv", "crates/rustc_codegen_spirv-types", "crates/spirv-builder", "crates/spirv-std", "crates/spirv-std/shared", "crates/spirv-std/macros", + "tests", "tests/deps-helper", ] diff --git a/README.md b/README.md index e8dee24b65..2768a9281d 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ **Rust as a first-class language and ecosystem for GPU graphics & compute shaders** [![Build status](https://github.com/rust-gpu/rust-gpu/actions/workflows/ci.yaml/badge.svg)](https://github.com/rust-gpu/rust-gpu/actions/workflows/ci.yaml) +[![Documentation](https://img.shields.io/badge/docs-API-blue)](https://rust-gpu.github.io/rust-gpu/api/rustc_codegen_spirv) @@ -92,7 +93,6 @@ The scope of this overall project is quite broad, but is in multiple stages - This is the same mechanism that [rustc_codegen_cranelift](https://github.com/bjorn3/rustc_codegen_cranelift) and [rustc_codegen_gcc](https://github.com/antoyo/rustc_codegen_gcc) use. - Currently only [SPIR-V] support is planned, [Vulkan]()'s open compiler target - Possible a future version could support [DXIL](https://github.com/microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst) (the target for DirectX) or [WGSL](https://github.com/gpuweb/gpuweb/tree/main/wgsl) (the WebGPU shading language that's bijective with SPIR-V) -- Focus on Vulkan compute shaders first, then after Vulkan graphics shaders - [Cargo](https://github.com/rust-lang/cargo/) and [crates.io](https://crates.io) support to develop and publish SPIR-V crates ## Process diff --git a/crates/spirv-std/README.md b/crates/spirv-std/README.md index dbd80bceb9..fe399ca04e 100644 --- a/crates/spirv-std/README.md +++ b/crates/spirv-std/README.md @@ -42,7 +42,7 @@ Check out [The `rust-gpu` Dev Guide][gpu-guide] for information on how to get st Experiment with rust-gpu shaders in-browser at [SHADERed][shadered]. -[migration]: https://github.com/EmbarkStudios/rust-gpu/blob/097ba40bedd74eeaa296e719ef7e41f2d3d76c23/docs/src/migration-to-register-tool.md -[source]: https://github.com/EmbarkStudios/rust-gpu/blob/69cb69d28f1e64420ee31ade5e7dffb7c5621e89/examples/shaders/sky-shader/src/lib.rs +[migration]: https://github.com/rust-gpu/rust-gpu/blob/097ba40bedd74eeaa296e719ef7e41f2d3d76c23/docs/src/migration-to-register-tool.md +[source]: https://github.com/rust-gpu/rust-gpu/blob/69cb69d28f1e64420ee31ade5e7dffb7c5621e89/examples/shaders/sky-shader/src/lib.rs [gpu-guide]: https://rust-gpu.github.io/rust-gpu/book/ [shadered]: https://shadered.org/shaders?language=rust&sort=hot diff --git a/deny.toml b/deny.toml index 412575f0c7..c878c007ad 100644 --- a/deny.toml +++ b/deny.toml @@ -82,7 +82,7 @@ license-files = [ # This section is considered when running `cargo deny check sources`. # More documentation about the 'sources' section can be found here: -# https://rust-gpu.github.io/cargo-deny/checks/sources/cfg.html +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html [sources] # Lint level for what to happen when a crate from a crate registry that is not # in the allow list is encountered diff --git a/docs/src/building-rust-gpu.md b/docs/src/building-rust-gpu.md index 016f88b612..0900a102d8 100644 --- a/docs/src/building-rust-gpu.md +++ b/docs/src/building-rust-gpu.md @@ -4,7 +4,7 @@ 1. Clone the repository. ```shell - git clone --recurse-submodules https://github.com/EmbarkStudios/rust-gpu + git clone --recurse-submodules https://github.com/rust-gpu/rust-gpu ``` 1. **optional** Install [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools#downloads) and add it to your `PATH`. You can skip this step if you just want to run examples with the defaults. See [Using installed SPIRV-Tools](#using-installed-spirv-tools) if you decide to go with this option. @@ -40,9 +40,9 @@ cargo run \ You should see `warning: use-installed-tools feature on, skipping compilation of C++ code` during the compilation, but otherwise the build will function just the same as if you compiled the C++ code, with the exception that it will fail if you don't have SPIRV-Tools installed correctly. [spirv-builder]: https://rust-gpu.github.io/rust-gpu/api/spirv_builder/index.html -[examples]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples -[examples/runners]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples/runners -[examples/runners/ash]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples/runners/ash -[examples/runners/cpu]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples/runners/cpu -[examples/runners/wgpu]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples/runners/wgpu -[examples/shaders]: https://github.com/EmbarkStudios/rust-gpu/tree/main/examples/shaders +[examples]: https://github.com/rust-gpu/rust-gpu/tree/main/examples +[examples/runners]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/runners +[examples/runners/ash]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/runners/ash +[examples/runners/cpu]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/runners/cpu +[examples/runners/wgpu]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/runners/wgpu +[examples/shaders]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/shaders diff --git a/docs/src/publishing-rust-gpu.md b/docs/src/publishing-rust-gpu.md index a8ce516013..7116f03aba 100644 --- a/docs/src/publishing-rust-gpu.md +++ b/docs/src/publishing-rust-gpu.md @@ -4,6 +4,7 @@ This is a task list for the maintainers of rust-gpu to remember to do when publi of rust-gpu (probably not useful for contributors without access to our crates.io account 😋) The published crates and their relative locations are: + 1. `spirv-std-types` (`crates/spirv-std/shared`) 2. `spirv-std-macros` (`crates/spirv-std/macros`) 3. `spirv-std` (`crates/spirv-std`) @@ -16,7 +17,7 @@ These are the steps: 1. Bump all the versions to the next one in the workspace's `Cargo.toml`. This project uses workspace inheritance, so this is the only place you'll find these actual versions. Make sure to pin the - rust-gpu dependencies to their *exact* versions using the `=`-notation, such as: `=0.4.0`. All crates + rust-gpu dependencies to their _exact_ versions using the `=`-notation, such as: `=0.4.0`. All crates are built and published in tandem so you're not expected to be able to mix and match between versions. 2. Add this new version to the table in `crates/spirv-builder/README.md` and make sure the correct nightly version is listed there as well. @@ -24,7 +25,7 @@ These are the steps: 4. Pull the merged `main` branch. 5. Tag `main` with the version: `git tag v0.4.0` 6. Push the tag: `git push origin v0.4.0` -7. Publish the crates: `cd [crate] && cargo publish` in the order of the list above (make sure - `.cargo/credentials` is set to the project's token). The crates.io index might take some seconds to update +7. Publish the crates: `cd [crate] && cargo publish` in the order of the list above. + The crates.io index might take some seconds to update causing an error if the crates are published in quick succession. Wait a couple of seconds and try again 🙂.