diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-05 19:33:55 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-06 03:33:55 +0000 |
| commit | 7dabfa76ccfb396e9d2019e2b6e01259d1661dc5 (patch) | |
| tree | 8f9a39b9d25d04051d02e63450f66c852d744e62 /docs/user-guide/a2-03-wgsl-target-specific.md | |
| parent | ecc5a39feecbf73feedf352214406c8752af798a (diff) | |
Implement explciit binding for metal and wgsl. (#5778)
* Respect explicit bindings in wgsl emit.
* Implement explciit binding generation for metal and wgsl.
* Update toc.
* Fix warnings in tests.
* Fix tests.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'docs/user-guide/a2-03-wgsl-target-specific.md')
| -rw-r--r-- | docs/user-guide/a2-03-wgsl-target-specific.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/user-guide/a2-03-wgsl-target-specific.md b/docs/user-guide/a2-03-wgsl-target-specific.md index 75a2a6da3..c802a682b 100644 --- a/docs/user-guide/a2-03-wgsl-target-specific.md +++ b/docs/user-guide/a2-03-wgsl-target-specific.md @@ -156,3 +156,9 @@ Matrix type translation A m-row-by-n-column matrix in Slang, represented as float`m`x`n` or matrix<T, m, n>, is translated to `mat[n]x[m]` in WGSL, i.e. a matrix with `n` columns and `m` rows. The rationale for this inversion of terminology is the same as [the rationale for SPIR-V](a2-01-spirv-target-specific.md#matrix-type-translation). Since the WGSL matrix multiplication convention is the normal one, where inner products of rows of the matrix on the left are taken with columns of the matrix on the right, the order of matrix products is also reversed in WGSL. This is relying on the fact that the transpose of a matrix product equals the product of the transposed matrix operands in reverse order. + +## Explicit Parameter Binding + +The `[vk::binding(index,set)]` attribute is respected when emitting WGSL code, and will translate to `@binding(index) @group(set)` in WGSL. + +If the `[vk::binding()]` attribute is not specified by a `:register()` semantic is present, Slang will derive the binding from the `register` semantic the same way as the SPIRV and GLSL backends.
\ No newline at end of file |
