Skip to content

fix No OpEntryPoint for non-public entry points#565

Queued
39ali wants to merge 1 commit intoRust-GPU:mainfrom
39ali:entry-point-pub
Queued

fix No OpEntryPoint for non-public entry points#565
39ali wants to merge 1 commit intoRust-GPU:mainfrom
39ali:entry-point-pub

Conversation

@39ali
Copy link
Copy Markdown

@39ali 39ali commented Apr 13, 2026

fixes the confusing No OpEntryPoint instruction was found you get when entry point is private
#293

@LegNeato
Copy link
Copy Markdown
Collaborator

Ohhh, that is a good idea! I was be concerned about automatic pub breaking encapsulation, but putting it as part of the macro is extremely smart as (AFAICT) it solves that....any code not targeting spirv will have the macro stripped away and still see the private function.

@Firestar99 do you see any potential issues I am missing?

Copy link
Copy Markdown
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an improvement, but doesn't solve it for the following code:

mod private {
    #[spirv(fragment)]
    pub fn main() {}
}

I think we can merge this anyway, but do note that when I do get back to the asm!-based entry point system the next weeks, it shouldn't suffer from this problem at all, since global_asm! is always accessible (doesn't need to be "monomorphized" by being pub and accessible from potentially external crates).

@39ali
Copy link
Copy Markdown
Author

39ali commented Apr 14, 2026

@Firestar99 we can #[export_name] and have some unique hash for functions, that should fix it but if entry point system is changing then this should be okish for now

@LegNeato LegNeato added this pull request to the merge queue Apr 14, 2026
@LegNeato
Copy link
Copy Markdown
Collaborator

Thank you for the PR! 🍻

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants