-
Notifications
You must be signed in to change notification settings - Fork 244
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
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 |
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. |
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. 😄 |
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!
@@ -463,6 +463,9 @@ pub fn main() { | |||
let vector = glam::Vec2::new(1.0, 2.0); | |||
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 😄
@@ -568,7 +575,7 @@ fn image_read() { | |||
val(r#" | |||
#[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
glam
as a dependency fromspirv-std
. Since we still use it for our tests, we currently have to patch it with a forked version ofglam
that contains the trait implementations we need untilglam
can depend on these changes directly. It also exportsderivative::derive_impl
as a hidden export so thatglam
can use it in its implementation.This PR also introduces a new
const-generics
feature flag, and reintroduces some of the const generics in order to be able enforce the restrictions on these types through theVector
trait. 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