Add derive macros for layout validation and enhance shader compilation#84
Merged
Add derive macros for layout validation and enhance shader compilation#84
Conversation
f147386 to
3de5e73
Compare
- Introduced a new `goldy_derive` crate for derive macros, including `LayoutCheckable` for automatic layout validation of `#[repr(C)]` structs. - Updated `Cargo.toml` to include the new `derive` member and dependency. - Enhanced shader compilation functions to support layout checks, validating Rust struct layouts against Slang reflection during shader compilation. - Added new methods in the backend to handle layout checks and updated existing shader creation functions to accommodate these changes. - Implemented layout validation logic in the Slang compiler, allowing for deferred validation during shader compilation. - Updated tests to include layout checks, ensuring correctness in shader struct layouts across different backends.
3de5e73 to
ea1aa74
Compare
- Added optional layout validation for Rust `#[repr(C)]` structs against Slang during shader compilation using the `GOLDY_VALIDATE_LAYOUTS` environment variable. - Updated `AGENTS.md`, `DEBUGGING.md`, and `README.md` to include instructions for enabling layout checks and examples of usage. - Enhanced `shaders.md` and example files (`gradient.rs`, `checkerboard.rs`) to demonstrate the integration of layout validation in shader compilation. - Introduced `LayoutCheckable` derive macro in examples to ensure uniform buffer data matches the expected layout in shaders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
goldy_derivecrate for derive macros, includingLayoutCheckablefor automatic layout validation of#[repr(C)]structs.Cargo.tomlto include the newderivemember and dependency.Part of #80