entry points with an enum of exactly two variants fails
还没有人认领这个 Issue。
评估
调研方向
从错误中显示的 build-pass 用例 entry_point_enum_two_variants.rs 开始,复现将一个双变体 enum 传递给入口点时被拒绝的情况。跟踪入口点参数验证过程,该过程将 bools 报告为不受支持。确定预期的处理方式,并由一个通过的回归测试覆盖后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Rust
- 星标
- 3.4k
- 派生
- 126
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Rust-GPU/rust-gpu 的其他 Issue
-
enhancement
难度 1/5 1 小时以内 新手友好度 68/100
-
bug
-
enhancement
-
bug
难度 4/5 3-5 天 新手友好度 48/100
-
bug
难度 3/5 1-2 天 新手友好度 48/100
查看 Rust-GPU/rust-gpu 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2413 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
todo:ticket
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
taikoxyz/taiko-mono#22168 · 1 条评论 ·