-
Notifications
You must be signed in to change notification settings - Fork 33
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
glam dependency is not optional in spirv-std #146
Comments
Some time ago it was decided to remove this feature of being able to return whatever vector type and sample() will just return glam's Vec4 (or Vec3, Vec2, float ...). And the end user should just use If we really wanted to make |
About For example, |
We could try something like returning |
What if the Sampler types definitions or inner members where config guarded entirely? Instead of |
Let's say we were to make those features. Then if you'd made a library that implements some technique, you need to choose between the |
What would be the effective difference if glam remains the default enabled feature though? Glam would still be force fed with an option to change vector libraries |
Seems like the only one requiring num-traits "default", and thus "std" is rust-gpu itself (if I am reading that correctly) |
I've uploaded a minimum reproduction here: https://github.com/marstaik/rust-gpu-repro |
Perhaps if we stick to the I could see a world where certain cards need certain specialized representations, especially TPUs and NPUs. |
Found your issue:
I've made a repo detailing exactly how to setup rust-gpu with vulkano, feel free to take a look, even if you're graphics API is not vulkano it should be similar enough. We've already discussed internally that we need such an example repo for each major graphics API (wgpu, ash) and hopefully we'll get them ready before the next release. |
Thanks @Firestar99 , in addition to those two steps, I had to look at the example to enable some things like .multimodule(true)
.spirv_metadata(SpirvMetadata::NameVariables)
.print_metadata(MetadataPrintout::DependencyOnly)
.build()?; despite not using vulkano, (I am using ash directly). But It does all seem to build now. I was getting errors from the spriv-tools it seems:
Back to the original topic, @LegNeato , using the mint trait would allow you to template/generic the Samplers by your own Vector type, correct? So in user code we would probably have to do a type declaration like so: // nalegbra
pub type SamplerNa = SamplerImpl<Vector3<f32>>;
pub type SamplerGlam = SamplerImpl<Vec3>; If that works, I don't mind putting some time into getting this working. |
I knew there was another issue I found, but forgot when I started writing the list. All shader entry points must be accessible as |
The |
@marstaik yeah, that's my thinking. I'm not experienced enough with this area to know if that's a good idea or not. |
The readme in
spirv-std
states:However, there is no feature flag that actually controls the glam bindings. As such, on a clean dependency with no features specified, spirv-std requires
glam
as a dependency to build. Also, the workspace leveldefault-features=false
does not seem to get used properly, making std included with glam.I would definitely like to see this optional, and then perhaps introduce an nalgebra helper as well in the future.
The text was updated successfully, but these errors were encountered: