You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ET-VK][BE][ez] Enable automatic layout slot index incrementing
## Context
Currently, in shaders we have to declare the binding slot that layout bindings will bind to explicitly, i.e.
```
${layout_declare_tensor(0, "w", "t_out", DTYPE, STORAGE)}
${layout_declare_buffer(1, "r", "nchw_in", DTYPE)}
${layout_declare_ubo(2, "ivec4", "sizes")}
```
However, this can get a little tedious when making many layout declarations. This diff improves the situation by adding the `B` variable which will automatically increment the binding slot whenever a layout binding is declared. Now we can write
```
${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)}
${layout_declare_buffer(B, "r", "nchw_in", DTYPE)}
${layout_declare_ubo(B, "ivec4", "sizes")}
```
I may make a follow up diff to change all layout declarations to use `B` across all shaders in the codebase later on.
Differential Revision: [D62210119](https://our.internmc.facebook.com/intern/diff/D62210119/)
ghstack-source-id: 241066643
Pull Request resolved: #5091
0 commit comments