Expose more information on compiled entry points
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
Problem
Right now the entry_points in CompileResult contains names only. This limits limits our/the users ability to generate code.
Proposal
Exposing some additional information on them could help with generating code, without prior knowledge of how each entry point works (like having a dictionary of graphics and compute shaders).
Expose SpirV representation
Right now I am thinking of putting a version of the generated EntryPoint spirv lang struct into rustc_codegen_spirv_types because of how easy it is to implement.
pub struct EntryPoint {
pub execution_model: spirv::ExecutionModel,
pub entry_point: spirv::Word,
pub name: String,
pub interface: Vec<spirv::Word>,
}
Use naga
Another idea I had was using naga::ir::EntryPoint
pub struct EntryPoint {
pub name: String,
pub stage: ShaderStage,
pub early_depth_test: Option<EarlyDepthTest>,
pub workgroup_size: [u32; 3],
pub workgroup_size_overrides: Option<[Option<Handle<Expression>>; 3]>,
pub function: Function,
}
but this is a bit detached from the underlying spirv (harder to parse from spirv code + less shader stages etc)
Unique struct
The best version would probably be a combination of the 2.
Even if it doesn't end up getting merged, I'll do it for my own project. All insights are welcome.
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
Start at CompileResult.entry_points and review the proposed EntryPoint in rustc_codegen_spirv_types alongside naga::ir::EntryPoint. First resolve which representation and metadata the project should expose; done means CompileResult provides agreed entry-point information sufficient for code generation without prior shader knowledge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100