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

[wgsl-in] vector constructor and splat constructors require decimal point for float types #2518

Closed
neilsarkar opened this issue Sep 27, 2023 · 2 comments

Comments

@neilsarkar
Copy link

@vertex fn vs(
  @location(0) pos: vec4f,
  @builtin(vertex_index) vertexIndex : u32
) -> @builtin(position) vec4f {
  return pos;
}

@fragment fn fs() -> @location(0) vec4f {
  return vec4f(1, 0, 1, 1);
}

this gives an error:

Shader validation error: 
  ┌─ Hello World Shader:9:10
  │
9 │   return vec4f(1, 0, 1, 1);
  │          ^^^^^^^^^^^^^^^^^ naga::Expression [5]


    Entry point fs at Fragment is invalid
    Expression [5] is invalid
    Composing 0's component type is not expected

this can be fixed by changing the line to:

return vec4f(1.0, 0.0, 1.0, 1.0);

this is unexpected coming from native webgpu in the browser, where vec4f(1,0,1,1) will correctly render magenta.

it seems to be described in the wgsl spec here: https://www.w3.org/TR/WGSL/#conversion-rank

is the divergence intentional? or is it something we want to catch up to in the wgsl spec?

@neilsarkar neilsarkar changed the title [wgsl-in] vector splat constructor requires decimal for float types [wgsl-in] vector constructor and splat constructors requires decimal for float types Sep 27, 2023
@neilsarkar neilsarkar changed the title [wgsl-in] vector constructor and splat constructors requires decimal for float types [wgsl-in] vector constructor and splat constructors require decimal for float types Sep 27, 2023
@neilsarkar neilsarkar changed the title [wgsl-in] vector constructor and splat constructors require decimal for float types [wgsl-in] vector constructor and splat constructors require decimal point for float types Sep 27, 2023
@teoxoy
Copy link
Member

teoxoy commented Sep 27, 2023

Thanks for the report, this is not yet implemented.
Closing as duplicate of gfx-rs/wgpu#4400.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@neilsarkar
Copy link
Author

thanks, will follow that issue!

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