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

Allow using include_wgsl! in const contexts #5872

Merged
merged 2 commits into from
Jun 24, 2024
Merged

Conversation

9SMTM6
Copy link
Contributor

@9SMTM6 9SMTM6 commented Jun 24, 2024

Its not possible to call into in const contexts. But what into does here under the hood is what i replaced in, and since thats just the creation of an enum variant, one can do that in const contexts.

Connections
Nada.

Description
I want my shader module in a constant (no lifetimes to deal with, can be static), and I'd like to use the provided macro for it.

Testing
Try to call the old include_wgsl! to create a constant, see that it doesn't work. Repeat with this version, hussa it works now.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@9SMTM6 9SMTM6 marked this pull request as ready for review June 24, 2024 17:32
@9SMTM6 9SMTM6 requested a review from a team as a code owner June 24, 2024 17:32
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@teoxoy teoxoy enabled auto-merge (squash) June 24, 2024 17:35
@teoxoy teoxoy merged commit a7d4d2c into gfx-rs:trunk Jun 24, 2024
25 checks passed
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.

2 participants