在过去的几天里,我一直在学习wgpu,我有一点困惑。当我浏览wgpu示例(https://github.com/gfx-rs/wgpu/tree/master/wgpu/examples)时,它们使用这个语法作为它们的着色器:
struct VertexOutput {
@location(0) color: vec4<f32>,
@builtin(position) position: vec4<f32>,
}但我必须这样写我的着色器:
struct VertexOutput {
[[location(0)]] color: vec4<f32>;
[[builtin(position)]] position: vec4<f32>;
};我更喜欢@语法而不是[[]]语法。我猜想这是我需要在我的Cargo.toml中启用的一个特性,但是我还没有能够找到这是什么特性。因此,如果有人能告诉我如何在我的wgsl着色器中使用@语法,那将是非常感谢的。
https://stackoverflow.com/questions/72600476
复制相似问题