Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General shader improvements, specifically targeting rust-gpu #2482

Merged
merged 9 commits into from
Mar 3, 2024

Conversation

Firestar99
Copy link
Contributor

@Firestar99 Firestar99 commented Mar 1, 2024

This is a collection of a bunch of smaller shader-related bugs and issues I came across, including ones which only trigger when using rust-gpu. See changelog below, and these non-user facing or less unimportant changes:

  • replaced #[macro_use] extern crate XXX; with normal imports
  • added tests for shader! reflect() for both glsl and rust-gpu shaders
  • fixed mesh shader output not being arrayed (as mesh shaders are not yet released, I wouldn't put it into the changelog)
  • structs in shader in/out interface got an explanatory panic message that they are not yet supported, instead of "Type not found or invalid"
  1. Update documentation to reflect any user-facing changes - in this repository.

  2. Make sure that the changes are covered by unit-tests.

  3. Run cargo clippy on the changes.

  4. Run cargo +nightly fmt on the changes.

  5. Please put changelog entries in the description of this Pull Request
    if knowledge of this change could be valuable to users. No need to put the
    entries to the changelog directly, they will be transferred to the changelog
    file by maintainers right after the Pull Request merge.

    Please remove any items from the template below that are not applicable.

  6. Describe in common words what is the purpose of this change, related
    Github Issues, and highlight important implementation aspects.

Changelog:

### Breaking changes
Changes to `shader!` macro:
- Shaders included via `bytes: <path-to-spv>` **must** no longer specify a shader type, e.g. `ty: <vertex>`.

### Additions
Changes to `shader!` macro:
- added `generate_structs: true` option that may be used to disable rust structs from generating. Useful in e.g. rust-gpu contexts where such functionality is not needed.

### Bugs fixed
Changes to `shader!` macro:
- fixed shader struct names that are invalid rust idents from panicing the shader! macro. Rust-gpu emitted struct names such as `foo::bar::MyStruct` now work.

vulkano-shaders/src/codegen.rs Outdated Show resolved Hide resolved
Co-authored-by: Rua <ruawhitepaw@gmail.com>
@Rua Rua merged commit 093b43e into vulkano-rs:master Mar 3, 2024
5 checks passed
Rua added a commit that referenced this pull request Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants