entry points with an enum of exactly two variants fails
オープン
まだ誰も着手していません。
bug
- 主要言語
- Rust
- スター
- 3.4k
- フォーク
- 126
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Rust-gpu rejects entry points with an enum of exactly two variants and no values. rustc seems to convert those to bools, and we have explicit checks to fail emitting bools. Maybe we should even reconsider whether we actually want to block bools this way, and handle them as two variant enums?
// build-pass
use spirv_std::spirv;
use spirv_std::glam::Vec4;
pub enum MyEnum {
Variant1,
Variant2,
}
#[spirv(fragment)]
pub fn main(
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] value: &MyEnum,
out: &mut Vec4,
) {
*out = match value {
MyEnum::Variant1 => Vec4::new(1., 0., 0., 1.),
MyEnum::Variant2 => Vec4::new(0., 1., 1., 1.),
}
}
fails with:
error: entry-point parameter cannot contain `bool`s
--> $DIR/entry_point_enum_two_variants.rs:12:70
|
12 | #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] value: &MyEnum,
| ^^^^^^^
error: aborting due to 1 previous error
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
エラーに示されている build-pass ケース entry_point_enum_two_variants.rs から始め、2つの variant を持つ enum をエントリーポイントに渡したときの拒否を再現します。bools を未サポートとして報告するエントリーポイント引数の検証を追跡します。意図した処理が決定され、成功するリグレッションテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100