Skip to content

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

@LegNeato

Description

@LegNeato
Contributor

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.

Activity

LegNeato

LegNeato commented on Mar 28, 2024

@LegNeato
ContributorAuthor

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

rust-gpu-bot

rust-gpu-bot commented on Nov 13, 2024

@rust-gpu-bot

This issue is now being tracked at: Rust-GPU/rust-gpu#60

LegNeato

LegNeato commented on Nov 23, 2024

@LegNeato
ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t: enhancementA new feature or improvement to an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @LegNeato@rust-gpu-bot

        Issue actions

          Warn (or error) on a non-pub entrypoint · Issue #1140 · EmbarkStudios/rust-gpu