(Naga) Cooperative Matrix Support #8251
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connections
Blocked by gfx-rs/rspirv#265
Since rspirv fails validation of the product, even though it's correct.
Description
Adding shader support for KHR_cooperative_matrix. Considering a rather simple scope that is portable between Vulkan and Metal.
Testing
Adds tests.
Squash or Rebase?
Rebase.
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.API choices
SPIRV and Metal have a fine intersection of the cooperative matrix functionality, with some caveats:
coop_mat
.OpCooperativeMatrixLoadKHR
andOpCooperativeMatrixMulAddKHR
as expressions andOpCooperativeMatrixStoreKHR
as a statement. Metal has all of them 3 as statements. I figured the arithmetic operation is defined as "a*b + c", which is an expression, and also the inference of the result type is straightforward. The "store" has to be a statement, and it has practically the same signature as "load", which can't trivially infer the result type. So both of them are expressed as statements.