-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In your blog post, you've updated the shaders for the new WGSL @attribute
syntax, but in this repo, the vertex and fragment shaders still follow the old-style double square-brackets syntax.
webgpu-seed/src/shaders/triangle.frag.wgsl
Lines 1 to 4 in 1ee2bdd
[[stage(fragment)]] | |
fn main([[location(0)]] inColor: vec3<f32>) -> [[location(0)]] vec4<f32> { | |
return vec4<f32>(inColor, 1.0); | |
} |
webgpu-seed/src/shaders/triangle.vert.wgsl
Lines 1 to 13 in 1ee2bdd
struct VSOut { | |
[[builtin(position)]] Position: vec4<f32>; | |
[[location(0)]] color: vec3<f32>; | |
}; | |
[[stage(vertex)]] | |
fn main([[location(0)]] inPos: vec3<f32>, | |
[[location(1)]] inColor: vec3<f32>) -> VSOut { | |
var vsOut: VSOut; | |
vsOut.Position = vec4<f32>(inPos, 1.0); | |
vsOut.color = inColor; | |
return vsOut; | |
} |
P.S. Thank you for the excellent posts 👏
alaingalvan
Metadata
Metadata
Assignees
Labels
No labels