Expose more information on compiled entry points
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 3.4k
- Forks
- 126
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei CompileResult.entry_points und prüfe den vorgeschlagenen EntryPoint in rustc_codegen_spirv_types im Vergleich zu naga::ir::EntryPoint. Kläre zunächst, welche Repräsentation und Metadaten das Projekt bereitstellen sollte; abgeschlossen ist die Aufgabe, wenn CompileResult ausreichende vereinbarte Informationen zu den Einstiegspunkten für die Codegenerierung ohne vorherige Kenntnis des Shaders bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- backend-api-design, compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100