Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
21c3a51 to
d5dcee5
Compare
afd1ab8 to
93c683b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ed67d48 to
8ccad08
Compare
25a5bb9 to
bb6ae0a
Compare
e775214 to
724cee2
Compare
724cee2 to
28001b4
Compare
|
Alright, I've implemented all of the feedback.
Well if we nuke the old system, we can't upgrade rust-gpu in Ark until C-like enums are stabilised or we change the parts of Ark to not use reflection for entry points. So I do think it's worth keeping them both for a short time, I've also added a deprecated message if you have the const generics feature enabled, so if you can use it, it warns to move to the new type. |
khyperia
left a comment
There was a problem hiding this comment.
LGTM pending nits.
Just realized, do we want to export common type aliases? Say, for all the types we already have explicitly defined, e.g. pub type Image2D = Image!(2d, type=f32, sampled) - might be nice for both examples for users of how to use the macro, plus saves users having to figure out e.g. what the heck sampled means and if they want it or not.
|
Oh yeah, also adding docs to the rust-gpu book on the macro syntax would be good, but that can be done in a follow-up if you'd like (file an issue if so). |
The syntax is documented on the macro itself so when you visit the |
People look at the book instead of the API docs when trying to figure out language constructs (where language = DSL in this case), e.g. |
3c1ef3c to
6e7d846
Compare
6e7d846 to
0ab505c
Compare
0ab505c to
4aca806
Compare
* Add parameterized Image type * nits * Update crates/spirv-std/src/lib.rs * Update crates/rustc_codegen_spirv/src/symbols.rs * Update crates/rustc_codegen_spirv/src/symbols.rs * Update symbols.rs
This PR refactors
Imagein the backend to not use attributes to determine things like dimensionality and depth, and to instead accept them as const generics as parameters. This has the advantage of only needing a singleImagetype as opposed previously to requiring a new type for each combination, and also allows us to have enums to represent all of the possibilities rather than usingu32s directly.Additions
macros::Imagea new procedural macro for definingImagetypes.image::SampleTypea trait that allows us to be generic of the underlying sampled type of the image.image::ImageCoordinatea trait built on top ofVectorfor parameterising image coordinate vectors based on the sampled type, dimensionality, and arrayed-ness of the Image.spirv_typescrate for holding types that are useful in bothspirv-stdandspirv-std-macros.Re-works
crate/spirv-std-macroshas been moved into thespirv-stdfolder asmacrosbeside thesharedcrate, this keeps the folder structure cleaner.