Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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