You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting #[spirv(fragment)] on a non-pub function, rust-gpu errors with an obtuse error:
error: error:0:0 - No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used.
This case should be detected and warned or even made an error if it is not supported. Further, the error message should be fixed as suggested in EmbarkStudios/rust-gpu#1139.
The text was updated successfully, but these errors were encountered:
to add context to this, it's silly like this because specifically the #[spirv(...)] attributes that denote an entry-point are only processed when that function is codegen'd. this also means you can probably cause it to be monomorphized more than once if you do weird things with calling it from other functions :/
Hi! Interested in helping here, but looking for some guidance if possible, because I'm a bit unsure.
Looking at where #[spirv()] is defined, crates/spirv-std/macros/src/lib.rs, it seems like the only thing that we really have to add is something like
let input = syn::parse_macro_input!(item asItemFn);if !matches!(input.vis,Visibility::Public(_)){panic!("The `spirv` macro can only be applied to public functions.");}
error: custom attribute panicked
--> src/main.rs:5:1
|
5 | #[spirv(fragment)]
| ^^^^^^^^^^^^^^^^^^
|
= help: message:The `spirv` macro can only be applied to public functions.
right? However, if warning is preferred over panic, then we might want to wait until this feature is stable.
If this is fine, I can get a PR in today, but unsure if this is exactly what is wanted here. Thanks in advance for any feedback!
(originally filed at EmbarkStudios/rust-gpu#1140)
When setting
#[spirv(fragment)]
on a non-pub function, rust-gpu errors with an obtuse error:This case should be detected and warned or even made an error if it is not supported. Further, the error message should be fixed as suggested in EmbarkStudios/rust-gpu#1139.
The text was updated successfully, but these errors were encountered: