Skip to content
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

Warn (or error) on a non-pub entrypoint #1140

Closed
LegNeato opened this issue Mar 26, 2024 · 2 comments
Closed

Warn (or error) on a non-pub entrypoint #1140

LegNeato opened this issue Mar 26, 2024 · 2 comments
Labels
t: enhancement A new feature or improvement to an existing one.

Comments

@LegNeato
Copy link
Contributor

LegNeato commented Mar 26, 2024

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 #1139.

@LegNeato LegNeato added the t: enhancement A new feature or improvement to an existing one. label Mar 26, 2024
@LegNeato
Copy link
Contributor Author

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
Copy link
Contributor Author

This is now Rust-GPU/rust-gpu#155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: enhancement A new feature or improvement to an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants
@LegNeato and others