Rust-GPU / Rust-GPU/rust-gpu

Expose more information on compiled entry points

オープン
#374 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Rust
スター
3.4k
フォーク
126
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

CompileResult.entry_points から始め、rustc_codegen_spirv_types の提案された EntryPoint を naga::ir::EntryPoint と併せて確認します。まず、プロジェクトが公開すべき表現とメタデータを決定します。CompileResult が、シェーダーに関する事前知識なしにコード生成を行うのに十分な、合意されたエントリーポイント情報を提供できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
backend-api-design, compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。