-
Notifications
You must be signed in to change notification settings - Fork 249
Decouple glam from spirv-std, add const-generics feature flag. #476
Conversation
b85d4f6 to
008ccc6
Compare
0f48669 to
e34f2ec
Compare
e34f2ec to
0baa4d7
Compare
0baa4d7 to
5327419
Compare
a3be4c6 to
f59221c
Compare
|
This should be ready for review. The main change is that I've added a new proc-macro called |
eddyb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo the concerns about whether the traits should be unsafe trait.
f59221c to
d2e9d36
Compare
|
@khyperia This should be ready for a final review. |
khyperia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending some outdated stuff
d2e9d36 to
1d0ca42
Compare
|
I need one of you to give me the green checkmark to merge. 😄 |
khyperia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved pending two more things, sorry!
| let element = unsafe { spirv_std::arch::vector_extract_dynamic(vector, 1) }; | ||
| assert!(2.0 == element); | ||
| let uvector = glam::UVec2::new(1, 2); | ||
| let element: u32 = unsafe { spirv_std::arch::vector_extract_dynamic(uvector, 1) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, meant to include this in my comment too but didn't want to spam too many comments
| let element: u32 = unsafe { spirv_std::arch::vector_extract_dynamic(uvector, 1) }; | |
| let element = unsafe { spirv_std::arch::vector_extract_dynamic(uvector, 1) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spam me with review comments 😄
| #[spirv(fragment)] | ||
| pub fn main(image: UniformConstant<StorageImage2d>, mut output: Output<glam::Vec2>) { | ||
| let coords = image.read(glam::IVec2::new(0, 1)); | ||
| let coords = image.read(glam::IVec2::new(0, 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: formatting
| let coords = image.read(glam::IVec2::new(0, 1)); | |
| let coords = image.read(glam::IVec2::new(0, 1)); |
|
oh. silly me, didn't see the automerge enable, that's why I didn't approve in my previous comment :P |
|
I'll make a followup PR for those |
This PR removes
glamas a dependency fromspirv-std. Since we still use it for our tests, we currently have to patch it with a forked version ofglamthat contains the trait implementations we need untilglamcan depend on these changes directly. It also exportsderivative::derive_implas a hidden export so thatglamcan use it in its implementation.This PR also introduces a new
const-genericsfeature flag, and reintroduces some of the const generics in order to be able enforce the restrictions on these types through theVectortrait. Having these under a feature flag, will allow us to iterate and add condt generic code without affecting Ark until they are released on stable at the end of the month, and then we can remove it for primitives.glam branch diff