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 attempting to use mixed operands during compound assignment #1906

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

Comments

@hanawatson
Copy link

naga seems not to accept compound assignments that use mixed vector and scalar operands, except in the case of the *= multiplication operator. Other mixed operands (vector+matrix, matrix+scalar) don't produce the same errors for me.

code example:

@compute @workgroup_size(1)
fn compute_main() {
	var var0: vec3<i32> = vec3<i32>();
	var0 += 3;
}

naga compilation error:

[2022-05-11T17:29:42Z ERROR naga::valid::expression] Left: Load { pointer: [2] } of type Vector { size: Tri, kind: Sint, width: 4 }
[2022-05-11T17:29:42Z ERROR naga::valid::expression] Right: Constant([3]) of type Scalar { kind: Sint, width: 4 }
error: 
  ┌─ test.wgsl:4:7
  │
4 │     var0 += 3;
  │          ^^ naga::Expression [5]

Entry point compute_main at Compute is invalid: 
	Expression [5] is invalid
	Operation Add can't work with [3] and [4]
@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
@teoxoy
Copy link
Member

teoxoy commented Nov 17, 2022

This was fixed by #2049.

@teoxoy teoxoy closed this as completed Nov 17, 2022
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

No branches or pull requests

2 participants