wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

[wgsl-in] Expression `some_matrix.x` should be rejected

Open kpreid opened this issue 10 months ago • 0 comments

Description wgpu/naga accepts a named component expression to access columns of a matrix (matrix.x, matrix.y, etc), but this is not permitted by the specification; the . syntax applies to vectors and structures, but not matrices.

Repro steps naga-cli accepts the following code:

fn foo(ip: mat4x4<f32>) -> f32 {
    return ip.z.z;
}

Expected vs observed behavior Should be an error; is not.

Platform wgpu 0.19.3; also tested at current git fb305b85f692f3fbbd9509b648dfbc97072f7465

kpreid avatar Apr 05 '24 04:04 kpreid