"No OpEntryPoint instruction was found" for public function
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behaviour
Non-public submodules should be supported, but instead I'm getting this:
Compiling ab-proof-of-space-gpu v0.1.0 (ab-proof-of-space-gpu)
warning: function `main_cs` is never used
--> src/shaders.rs:10:8
|
10 | pub fn main_cs(
| ^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
error: No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used.
|
= note: module `target/debug/build/ab-proof-of-space-gpu-dc89fe269d0c81ad/out/spirv-unknown-vulkan1.1/release/deps/ab_proof_of_space_gpu.spv`
warning: an unknown error occurred
|
= note: spirv-opt failed, leaving as unoptimized
= note: module `target/debug/build/ab-proof-of-space-gpu-dc89fe269d0c81ad/out/spirv-unknown-vulkan1.1/release/deps/ab_proof_of_space_gpu.spv`
error: error:0:0 - No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used.
|
= note: spirv-val failed
= note: module `target/debug/build/ab-proof-of-space-gpu-dc89fe269d0c81ad/out/spirv-unknown-vulkan1.1/release/deps/ab_proof_of_space_gpu.spv`
Slapping #[unsafe(no_mangle)] is sufficient to bypass this error, making submodule publicly reachable too.
I think #[spirv(..)] macro should be able to do something about it automatically to ensure it is exposed properly.
Kind of related to https://github.com/Rust-GPU/rust-gpu/issues/156
Example & Steps To Reproduce
- Have a shader in submodule that is not publicly reachable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with a shader function in a non-public submodule, using the reported #[spirv(..)] macro and comparing it with the #[unsafe(no_mangle)] workaround. Inspect the macro's handling of public functions and the generated SPIR-V entry points; done means the non-public submodule case validates without requiring the manual attribute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100