[Migrated] Using `arch::ignore_intersection` causes shader compilation to fail
オープン
まだ誰も着手していません。
- 主要言語
- Rust
- スター
- 3.4k
- フォーク
- 126
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1099
Old labels: t: bug
Originally creatd by Steelbirdy on 2023-11-13T21:07:54Z
Expected Behaviour
Shader crate successfully compiles
Example & Steps To Reproduce
#[spirv(any_hit)]
pub fn my_any_hit() {
let p = Vec3A::ZERO;
if p.length_squared() < 1e-3 {
unsafe { spirv_std::arch::ignore_intersection(); }
}
}
- Use the above snippet in a shader crate
- Compilation fails
Replacing this with the below snippet causes it to compile.
#[spirv(any_hit)]
pub fn my_any_hit() {
let p = Vec3A::ZERO;
if p.length_squared() < 1e-3 {
my_ignore_intersection();
}
}
#[inline(never)]
fn my_ignore_intersection() {
unsafe { spirv_std::arch::ignore_intersection(); }
}
System Info
- Rust: 1.71.0-nightly (1a5f8bce7 2023-05-26)
- OS: Windows 11
- GPU: NVIDIA RTX 3060 Ti
Backtrace
Backtrace
error: Selection must be structured
OpBranchConditional %1274 %1275 %1276
|
= note: module `C:\Users\Pat\CLionProjects\rayven_gpu2\target\spirv-builder\spirv-unknown-vulkan1.2\release\deps\shader.spv`
warning: an unknown error occurred
|
= note: spirv-opt failed, leaving as unoptimized
= note: module `C:\Users\Pat\CLionProjects\rayven_gpu2\target\spirv-builder\spirv-unknown-vulkan1.2\release\deps\shader.spv`
error: error:0:0 - Selection must be structured
OpBranchConditional %1274 %1275 %1276
|
= note: spirv-val failed
= note: module `C:\Users\Pat\CLionProjects\rayven_gpu2\target\spirv-builder\spirv-unknown-vulkan1.2\release\deps\shader.spv`
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された any-hit shader snippet でまず失敗を再現し、ヘルパー関数を使うバリアントと比較します。報告された OpBranchConditional の周辺にある生成済み SPIR-V を調べ、spirv-opt と spirv-val を使用して、ignore_intersection の直接呼び出しがなぜ非構造化された選択を生成するのかを特定します。元の snippet がコンパイルされ、SPIR-V の検証に合格すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- compilers, computer-graphics
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100