Rust-GPU / Rust-GPU/rust-gpu

Try to map `spirv-val` output to Rust code

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

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

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

説明

I just got an error that looks like this:

error: error:0:0 - OpInBoundsAccessChain result type (OpTypeStruct) does not match the type that results from indexing into the base <id> (OpTypeArray).
         %2764 = OpInBoundsAccessChain %_ptr_Function__struct_33 %2763 %uint_0
  |
  = note: spirv-val failed
  = note: module `.../spirv-unknown-vulkan1.2/debug/deps/....spv`

Unfortunately, the output isn't all that helpful, don't know how to debug it except commenting-out pieces of code until the error goes away. However, I do have a suspicion that _ptr_Function__struct_33 might be something that codegen controls, which in turn might mean ability to translate it back to something like the name of the data structure or file and line of code.

Also maybe debug builds could use something more descriptive than struct_33 to help with debugging, like a mangling scheme.

I'm compiling with these options:

let backend = cargo_gpu::Install::from_shader_crate(shader_crate.clone()).run()?;

let spirv_builder = backend
    .to_spirv_builder(shader_crate, "spirv-unknown-vulkan1.2")
    .print_metadata(MetadataPrintout::DependencyOnly)
    .spirv_metadata(SpirvMetadata::NameVariables)
    .release(false);

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

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

はじめの一歩

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

調査の方向性

cargo_gpu::Install のフローと to_spirv_builder(...).spirv_metadata(SpirvMetadata::NameVariables) の設定を確認し、続いて出力された spirv-val の診断で _ptr_Function__struct_33 がどのように示されるかを調査します。具体的なマッピングまたは命名の動作を定義し、示されている OpInBoundsAccessChain の失敗に対して検証します。生成された診断で関連する Rust のソースコンテキストを特定できるか、より説明的なデバッグ名を提供できれば、issue は完了です。

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

評価

技術スタック
rust
領域
compilers, devtools
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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