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

Make vec4f accept int parameter #4727

Closed
beaufortfrancois opened this issue Nov 20, 2023 · 3 comments
Closed

Make vec4f accept int parameter #4727

beaufortfrancois opened this issue Nov 20, 2023 · 3 comments

Comments

@beaufortfrancois
Copy link

In the codelab for webgpu, the vertex module code is invalid and it will throw error when you try to use it. The reason behind this error is that the vec4f expects a float literal instead of a int literal and can't convert between them.

// wrong
@vertex
fn vertexMain(@location(0) pos: vec2f) ->
  @builtin(position) vec4f {
  return vec4f(pos.x, pos.y, 0, 1);
}

// correct
@vertex
fn vertexMain(@location(0) pos: vec2f) ->
  @builtin(position) vec4f {
  return vec4f(pos.x, pos.y, 0.0, 1.0);
}

My understanding according to https://gpuweb.github.io/gpuweb/wgsl/#f32-builtin is that it should work:
image

Note that it works fine with Tint, in Chrome browser.
See original issue raised at googlecodelabs/feedback#1305

@teoxoy
Copy link
Member

teoxoy commented Nov 20, 2023

Thanks for the report! This will be addressed by #4400.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
@beaufortfrancois
Copy link
Author

Thanks @teoxoy! Any rough ETA?

@teoxoy
Copy link
Member

teoxoy commented Nov 20, 2023

@jimblandy is actively working on it, since a lot of CTS shaders are running into this as well.

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

2 participants