Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaders haven't been updated for new @ syntax #14

Open
rjkilpatrick opened this issue Feb 19, 2022 · 0 comments
Open

Shaders haven't been updated for new @ syntax #14

rjkilpatrick opened this issue Feb 19, 2022 · 0 comments

Comments

@rjkilpatrick
Copy link

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.

[[stage(fragment)]]
fn main([[location(0)]] inColor: vec3<f32>) -> [[location(0)]] vec4<f32> {
return vec4<f32>(inColor, 1.0);
}

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 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant