-
Notifications
You must be signed in to change notification settings - Fork 434
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
Using shader! macro through other crates without importing vulkano #2255
Comments
If you look at the macro's expansion, there's quite a few types from vulkano that it uses. What would you expect the macro to generate without using vulkano? |
Ah my bad, I think I misread your question. Your only concern is that you have to add |
Yes that is correct |
My thinking was that since it is in the list of dependencies for my crate it would be able to generate but I'm assuming that is not the case? |
I see, I'm sorry for by inability to read haha. This is an age old problem with proc macros in general, and I'm not sure if it's solvable.
Unortunately not. The place where the code is generated is in a downstream crate, and so if we generate types from the vulkano crate, that downstream crate must include it in its dependencies (just like in any other cicumstance, it's just that the code is generated in this case). I'll do some testing with what I have in mind, maybe it'll work. |
I don't think it's possible unfortunately. Even if we provided some way for a crate to configure where to find vulkano (e.g. re-exported from another crate), unless I'm mistaken there's still no (non-cursed) way to provide such a configuration without the user's involvement. |
I have a crate I wrote for myself to use across multiple projects for graphics that uses vulkano, however the shader macro will not run as the compiler cannot fund vulkano in the list of imported crates, is there a workaround for this, or will I have to import vulkano into every project along with my crate?
Use statement in my crate:
Shader code in my project:
Error produced when run:
The text was updated successfully, but these errors were encountered: