-
Notifications
You must be signed in to change notification settings - Fork 437
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
Support fixed-length arrays in graphics pipeline in addition to from_iter #1520
base: master
Are you sure you want to change the base?
Conversation
It seems like the runner isn't using the latest stable Rust. Minimum const generics have been stabilized since late last year. Can someone fix the CI? |
a772cf3
to
9404ff1
Compare
@danielzgtg While I agree it would be a good idea to support static arrays out of the box, we can't relay on unstable Rust version yet unfortunately, since not all users might be using unstable Rust. So we need to at least await for the feature stabilization on compiler's side. Also, it would be nice to avoid extra wrapping to But as a prototype for the future improvements I like your idea 👍 |
I didn't add any line of code that started with I think the problem is that our version of stable Rust is still last year's version |
I had already tried but I wasn't able to avoid the wrapping. I get errors about conflicting implementations of the trait. The only thing that might work is Rust's specialization, which is no longer planned to be merged any time soon. The other option is to attempt a rewrite of our use of generics throughout the entire library, something neither the end users nor I would like |
This works fine in stable rust:
|
@danielzgtg Well, there is a chance some users might still be using older versions of Rust too. I think it's important to have some level of back compatibility even if there is a lack of newest features. Anyway, to proceed with merging we need to upgrade Rust in Github Actions, and I don't have much experience with this stuff. btw, what was the motivation for the feature implementation? Is it a blocker for your work that uses Vulkano? I agree it's not bad to have static arrays, but at first glance it doesn't seem to be too critical to use runtime-sized, and in most cases users probably would prefer this option. |
I ported something over from I also planned to optimize my game by dynamically varying the number of instances to draw while keeping the buffer size fixed to avoid re-allocations. Another game would also have the concern of safely using compute shaders.
It's not really critical. I could always just wrap all my usages with an extra copy through
I never use runtime-sized slices for performance and safety reasons.
We aren't version 1.0 yet and the changelog is full of breaking changes. A breaking MSRV change shouldn't be much more |
@danielzgtg Understood. ok, I will try to propagate this change, but it may take some time. I need at least figure out how to update Github Actions. |
@AustinJ235 Do you know how to upgrade Rust version in Github Actions? @danielzgtg suggesting a feature that requires const generics. The implementation is a bit controversial, but I think it would be good to have this feature. |
You can use the rust-toolchain action to update the toolchain in your workflow. |
#1619 has changed
Seems like a solution for if we wanted to have separate nightly tests also along with a more up to date stable. |
@danielzgtg We finally updated to the latest Rustc, so I think we can proceed with this change now. Can you update your Pull Request please, and me or Austin will proceed with merging. Thank you for your work again, and I apologize for the too long review process. |
CHANGELOG_VULKANO.md
orCHANGELOG_VK_SYS.md
if knowledge of this change could be valuable to userscargo fmt
on the changesThis adds support for passing buffers statically typed as containing fixed-length arrays to draw calls.
It allows the following snippet of my code to work:
This allows me to avoid preventing GPU optimizations when using
CpuAccessibleBuffer
, avoid having to copy stuff into the buffer each frame, be able to efficiently write to the buffer in a compute shader, and be able to do all of that with the safety of Rust type checking.