rust-gpu icon indicating copy to clipboard operation
rust-gpu copied to clipboard

Warn (or error) on a non-pub entrypoint

Open LegNeato opened this issue 1 year ago • 1 comments

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.

LegNeato avatar Mar 26 '24 15:03 LegNeato

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 :/

LegNeato avatar Mar 28 '24 13:03 LegNeato