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 trait objects for CompileReflectShader #122

Merged
merged 8 commits into from
Sep 15, 2024
Merged

Conversation

chyyran
Copy link
Member

@chyyran chyyran commented Sep 15, 2024

This allows building on stable Rust, but not without some caveats.

  • C headers will not be regenerated when building with the stable feature.
  • There is a minor performance hit in initial shader compilation when building against stable Rust. This is due to boxed trait objects being used instead of impl Trait.
  • A higher MSRV is required when building against stable Rust.

CompileShader<..> + ReflectShader and be simplified to CompileReflectShader since FromCompilation instances are unique for (Compilation, Reflector)
Add a hidden `compile_boxed` function to CompileShader to support this. This is to allow Box<dyn CompileReflectShader> to work.
@chyyran chyyran merged commit 05d4884 into master Sep 15, 2024
20 checks passed
@chyyran chyyran deleted the trait-obj-reflect branch September 15, 2024 19:33
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.

1 participant