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] Error on provision of boolean scalars to all/any built-in functions #1911

Closed
hanawatson opened this issue May 11, 2022 · 1 comment · Fixed by #2445
Closed

[wgsl-in] Error on provision of boolean scalars to all/any built-in functions #1911

hanawatson opened this issue May 11, 2022 · 1 comment · Fixed by #2445
Labels
area: front-end Input formats for conversion kind: bug Something isn't working lang: WGSL WebGPU shading language

Comments

@hanawatson
Copy link

The specification provides two overloads for the all and any built-in functions, with one accepting boolean vectors and the second accepting boolean scalars. naga appears to only accept the former.

code example (analogous for any):

@compute @workgroup_size(1)
fn compute_main() {
	var var0 = all(true);
}

naga compilation error:

[2022-05-11T18:19:19Z ERROR naga::valid::expression] All/Any of type Scalar { kind: Bool, width: 1 }
error: 
  ┌─ all_any_scalar.wgsl:3:12
  │
3 │     var var0 = all(true);
  │               ^^^^^^^^^^ naga::Expression [2]

Entry point compute_main at Compute is invalid: 
	Expression [2] is invalid
	Relational argument [1] is not a boolean vector
@teoxoy teoxoy added kind: bug Something isn't working lang: WGSL WebGPU shading language area: front-end Input formats for conversion labels May 11, 2022
@teoxoy teoxoy added this to the WGSL Specification V1 milestone May 11, 2022
fornwall added a commit to fornwall/naga that referenced this issue Aug 19, 2023
fornwall added a commit to fornwall/naga that referenced this issue Aug 29, 2023
@teoxoy
Copy link
Member

teoxoy commented Aug 29, 2023

For future reference, these were added by gpuweb/gpuweb#2174.

fornwall added a commit to fornwall/naga that referenced this issue Aug 29, 2023
teoxoy pushed a commit that referenced this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: front-end Input formats for conversion kind: bug Something isn't working lang: WGSL WebGPU shading language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants