Skip to content

Keep #[spirv(...)] entry-points from being DCE'd by rustc.#591

Merged
eddyb merged 1 commit intoRust-GPU:mainfrom
LegNeato:issue-590
May 4, 2026
Merged

Keep #[spirv(...)] entry-points from being DCE'd by rustc.#591
eddyb merged 1 commit intoRust-GPU:mainfrom
LegNeato:issue-590

Conversation

@LegNeato
Copy link
Copy Markdown
Collaborator

@LegNeato LegNeato commented May 4, 2026

When building a shader as a dylib, rustc's cross_crate_inlinable heuristic can mark a pub fn entry-point as inlinable, which internalizes it and drops its OpEntryPoint before codegen ever runs.

Override the query to return false for entry-points.

Fixes #590.

When building a shader as a `dylib`, rustc's `cross_crate_inlinable`
heuristic can mark a `pub fn` entry-point as inlinable, which
internalizes it and drops its `OpEntryPoint` before codegen ever runs.

Override the query to return `false` for entry-points.

Fixes Rust-GPU#590.
@LegNeato LegNeato requested review from Firestar99 and eddyb as code owners May 4, 2026 01:51
@eddyb eddyb added this pull request to the merge queue May 4, 2026
Merged via the queue into Rust-GPU:main with commit c904e5c May 4, 2026
23 checks passed
@LegNeato LegNeato deleted the issue-590 branch May 4, 2026 05:56
konyogony referenced this pull request in konyogony/physics May 4, 2026
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.

No OpEntryPoint instruction was found, compute shaders silently dropped when multiple entry points exist in a crate

2 participants