rust-gpu
rust-gpu copied to clipboard
Warn (or error) on a non-pub entrypoint
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 https://github.com/EmbarkStudios/rust-gpu/issues/1139.
From discord eddyb says:
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 :/