-
Notifications
You must be signed in to change notification settings - Fork 935
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
Naga's typechecker ignores scalar kind when casting matrices #6441
Comments
I've added an example that crashes in current naga. |
I just realized that according to the spec, a matrix can have f32 or f16. However, since naga doesn't support f16, then perhaps this is not really a bug as of now. However, here's a minimal example for posterity which I'm guessing would break once support for f16 is implemented: @compute @workgroup_size(256, 1, 1) fn computeSomething() {
let m1: mat2x2<f32> = mat2x2<f32>(
vec2<f32>(1, 2),
vec2<f32>(3, 4)
);
let m2: mat2x2<f16> = mat2x2<f16>(m1);
} |
Since matrices are enforced to be |
Description
I think that there's a bug in the
naga/src/proc/typifier.rs
. Notably, when casting withAs
the new scalar kind, variablekind
, is not propagated to the outputscalar
, only thewidth
.Note a correct behavior on vectors where the kind is propagated to the generated vector:
Source:
wgpu/naga/src/proc/typifier.rs
Lines 881 to 884 in f669024
The text was updated successfully, but these errors were encountered: