diff --git a/.gitignore b/.gitignore index 26ffa26..5a5a5c6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ build/ .docusaurus target/ +.idea/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..fe5238d --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1782847189, + "narHash": "sha256-twXPFqFsrrY5r28Zh7Homgcp2gUMBgQ6WDS98Q/3xFI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b6018f87da91d19d0ab4cf979885689b469cdd41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..862a03d --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in { + devShell = with pkgs; + mkShell { + buildInputs = [ + yarn + ]; + }; + }); +} diff --git a/src/pages/changelog.md b/src/pages/changelog.md index 396dd6b..1d83ff5 100644 --- a/src/pages/changelog.md +++ b/src/pages/changelog.md @@ -4,59 +4,107 @@ title: Changelog sidebar_label: Changelog --- -# `rust-gpu` Changelog +# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - +### Changed 🛠 -## [Unreleased] +- Updated Rust nightly toolchain to `nightly-2026-04-11` +- [PR#249](https://github.com/Rust-GPU/rust-gpu/pull/249) updated to Rust 2024 edition +- [PR#380](https://github.com/Rust-GPU/rust-gpu/pull/380) `glam` types have the same layout on GPU and CPU to prevent sutle UB bugs with `Vec3`, requires at least glam `0.30.8` +- [PR#395](https://github.com/Rust-GPU/rust-gpu/pull/395) make many APIs explicitly use `glam` types instead of generics -### Changed 🛠 +- `ByteAddressableBuffer`: + - [PR#17](https://github.com/Rust-GPU/rust-gpu/pull/17) refactored `ByteAddressableBuffer` to allow reading from read-only buffers + - [PR#430](https://github.com/Rust-GPU/rust-gpu/pull/430) fix `ByteAddressableBuffer` stores of scalar pair types + - [PR#353](https://github.com/Rust-GPU/rust-gpu/pull/353) soundness fix: respect `read_scalar` errors instead of silently corrupting data -- [PR#170](https://github.com/Rust-GPU/rust-gpu/pull/170) updated toolchain to `nightly-2024-11-22` -- [PR#44](https://github.com/Rust-GPU/rust-gpu/pull/44) added support for [mesh shaders](https://www.khronos.org/blog/mesh-shading-for-vulkan) -- [PR#17](https://github.com/Rust-GPU/rust-gpu/pull/17) refactored [`ByteAddressableBuffer`](https://rust-gpu.github.io/rust-gpu/api/spirv_std/byte_addressable_buffer/struct.ByteAddressableBuffer.html) to allow reading from read-only buffers -- [PR#16](https://github.com/Rust-GPU/rust-gpu/pull/16) added - [`TypedBuffer`](https://rust-gpu.github.io/rust-gpu/api/spirv_std/struct.TypedBuffer.html), - an explicit way to declare inputs and outputs as buffers -- [PR#14](https://github.com/Rust-GPU/rust-gpu/pull/14) added subgroup intrinsics matching - glsl's - [`GL_KHR_shader_subgroup`](https://github.com/KhronosGroup/GLSL/blob/main/extensions/khr/GL_KHR_shader_subgroup.txt) -- [PR#13](https://github.com/Rust-GPU/rust-gpu/pull/13) allowed cargo features to be passed to the shader crate -- [PR#9](https://github.com/Rust-GPU/rust-gpu/pull/9) relaxed `glam` version requirements (`>=0.22, <=0.29`) -- [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275` -- [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) added `ignore` and `no_run` to documentation to make `cargo test` pass -- [PR#1112](https://github.com/EmbarkStudios/rust-gpu/pull/1112) updated wgpu and winit in example runners +- image: + - [PR#281](https://github.com/Rust-GPU/rust-gpu/pull/281) allow `SampledImage` to access `query_size_lod` and `query_size` + - [PR#361](https://github.com/Rust-GPU/rust-gpu/pull/361) added `Image::fetch_with_lod` shortcut for `Image::fetch_with(..., lod(...))` + - [PR#490](https://github.com/Rust-GPU/rust-gpu/pull/490) made `Image::fetch()` implicitly declare LOD 0 + - [PR#474](https://github.com/Rust-GPU/rust-gpu/pull/474) allow `Image::write()` to write scalar values into scalar images ### Fixed 🩹 -- [PR#200](https://github.com/Rust-GPU/rust-gpu/pull/200) fixed [#199](https://github.com/Rust-GPU/rust-gpu/issues/199) by correctly generating an `fmul` in the `log10` intrinsic -- [PR#174](https://github.com/Rust-GPU/rust-gpu/pull/174) fixed [#169](https://github.com/Rust-GPU/rust-gpu/issues/169) by handling signed integers in the `bswap` intrinsic -- [PR#1129](https://github.com/EmbarkStudios/rust-gpu/pull/1129) fixed [#1062](https://github.com/EmbarkStudios/rust-gpu/issues/1062) by not flipping the comparison of the rotate amount with zero +- [PR#552](https://github.com/Rust-GPU/rust-gpu/pull/552) massive speedups for mem2reg linker step +- [PR#364](https://github.com/Rust-GPU/rust-gpu/pull/364) fixed `libm` intrinsics for versions newer than `0.2.11` +- [PR#233](https://github.com/Rust-GPU/rust-gpu/pull/233) fixed array of array types +- [PR#167](https://github.com/Rust-GPU/rust-gpu/pull/167) fixed `debug_printf` macros not escaping `{` and `}` correctly + +- codegen: + - [PR#15](https://github.com/Rust-GPU/rust-gpu/pull/15) fixed signed `for` loops + - [PR#213](https://github.com/Rust-GPU/rust-gpu/pull/213) fixed `leading_zeros`, `trailing_zeros` and `count_ones` intrinsics + - [PR#174](https://github.com/Rust-GPU/rust-gpu/pull/174) added support for signed integer `bswap` + - [PR#363](https://github.com/Rust-GPU/rust-gpu/pull/363) allow `std::hint::black_box` to be a no-op on GPU + - [PR#518](https://github.com/Rust-GPU/rust-gpu/pull/518) replace `num_traits::Float::powi` implementation with `GLSL.std.450 Pow` intrinsics + - [PR#200](https://github.com/Rust-GPU/rust-gpu/pull/200) fixed `log10` intrinsic + - [PR#1129](https://github.com/EmbarkStudios/rust-gpu/pull/1129) fixed bit rotates being completely broken + - [PR#227](https://github.com/Rust-GPU/rust-gpu/pull/227) fixed array init with `0i32` incorrectly using `0u32` + - [PR#224](https://github.com/Rust-GPU/rust-gpu/pull/224) fixed typo swapping logical operations on bools + - [PR#302](https://github.com/Rust-GPU/rust-gpu/pull/302) optimize constant casts to avoid requiring `Int64` capabilities + +- spirv-val: + - [PR#512](https://github.com/Rust-GPU/rust-gpu/pull/512) fixed validation failures with newer `spirv-val` (v2025.5+) by folding `OpLoad` from `Private` variables with constant initializers + - [PR#456](https://github.com/Rust-GPU/rust-gpu/pull/456) fixed unused shared memory causing validation errors + - [PR#379](https://github.com/Rust-GPU/rust-gpu/pull/379) fixed Vulkan validation errors by erasing explicit layout decorations when disallowed + +- ICE: + - [PR#431](https://github.com/Rust-GPU/rust-gpu/pull/431) fixed divide-by-zero ICE + - [PR#453](https://github.com/Rust-GPU/rust-gpu/pull/453) fixed ICE on indirect function pointers ## [0.9.0] @@ -473,3 +521,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.0] Initial release. + +[Unreleased]: https://github.com/rust-gpu/rust-gpu/compare/v0.9.0...HEAD +[0.9.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.9.0 +[0.8.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.8.0 +[0.7.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.7.0 +[0.6.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.6.0 +[0.6.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.6.0 +[0.5.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.5.0 +[0.4.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.17]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.16]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.15]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.14]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.13]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.12]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.11]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.10]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.9]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.8]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.7]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.6]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.5]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.4]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.3]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.2]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.4.0-alpha.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.4.0 +[0.3.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.3.0 +[0.3.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.3.0 +[0.2.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.2 +[0.1.0]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.1 diff --git a/src/pages/index.tsx b/src/pages/index.tsx index ab13d92..3722ac8 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -23,17 +23,18 @@ const HeroCode: React.FC = ({ className = "" }) => { use glam::UVec3; use spirv_std::spirv; -enum Outcome { - Fizz, - Buzz, - FizzBuzz, +#[repr(u32)] +pub enum Outcome { + Fizz, + Buzz, + FizzBuzz, } trait Game { fn fizzbuzz(&self) -> Option; } -impl Game for u32 { +impl Game for usize { fn fizzbuzz(&self) -> Option { match (self % 3 == 0, self % 5 == 0) { (true, true) => Some(Outcome::FizzBuzz), @@ -47,9 +48,10 @@ impl Game for u32 { #[spirv(compute(threads(64)))] pub fn main( #[spirv(global_invocation_id)] id: UVec3, - #[spirv(storage_buffer)] output: &mut [Option; 64], + #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] + output: &mut [Option; 64], ) { - let index = id.x as u32; + let index = id.x as usize; output[index] = index.fizzbuzz(); }\ `; diff --git a/static/img/authors/LegNeato.png b/static/img/authors/LegNeato.png index af2feb3..d212351 100644 Binary files a/static/img/authors/LegNeato.png and b/static/img/authors/LegNeato.png differ diff --git a/static/img/authors/schell.png b/static/img/authors/schell.png index a9b7024..769bd2c 100644 Binary files a/static/img/authors/schell.png and b/static/img/authors/schell.png differ