We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Matrix + Matrix
WGSL test case:
[[stage(vertex)]] fn vertex() { let model = mat4x4<f32>( vec4<f32>(1.0, 0.0, 0.0, 0.0), vec4<f32>(0.0, 1.0, 0.0, 0.0), vec4<f32>(0.0, 0.0, 1.0, 0.0), vec4<f32>(0.0, 0.0, 0.0, 1.0), ); let foo = model + model; }
Panics at:
naga/src/back/spv/block.rs
Lines 321 to 328 in e69a70b
Workaround by decomposing the matrices into their column vectors and constructing a new matrix after adding the columns separately:
[[stage(vertex)]] fn vertex() { let model = mat4x4<f32>( vec4<f32>(1.0, 0.0, 0.0, 0.0), vec4<f32>(0.0, 1.0, 0.0, 0.0), vec4<f32>(0.0, 0.0, 1.0, 0.0), vec4<f32>(0.0, 0.0, 0.0, 1.0), ); let foo = mat4x4<f32>( model.x + model.x, model.y + model.y, model.z + model.z, model.w + model.w, ); }
I believe this is the transformation required for SpirV.
The text was updated successfully, but these errors were encountered:
I don't think WGSL supports that today, see the spec - https://gpuweb.github.io/gpuweb/wgsl/#arithmetic-expr
Sorry, something went wrong.
Looks like it does, though. In the “Matrix arithmetic” table.
Sorry, you are correct. I'm surprised it's in a separate section.
Workaround gfx-rs/naga#1527
074b47d
Successfully merging a pull request may close this issue.
WGSL test case:
Panics at:
naga/src/back/spv/block.rs
Lines 321 to 328 in e69a70b
Workaround by decomposing the matrices into their column vectors and constructing a new matrix after adding the columns separately:
I believe this is the transformation required for SpirV.
The text was updated successfully, but these errors were encountered: