Correct VK_KHR_cooperative_matrix coopMatLoad usage with shared variables?

Hi,

I would like to know how coopMatLoad from the VK_KHR_cooperative_matrix extension exactly works when loading from shared variables. The definition is:

void coopMatLoad(out coopmat m, float_or_float16_t[] buf, uint element, uint stride, colMajor / rowMajor);

  • m is a cooperative matrix where to store the results of the load operation.
  • buf is a 32-bit or 16-bit buffer (it can be also a shared variable).
  • element is an offset inside the buffer where to load from (in this case, buf).
  • stride is the stride to apply to the loading operation, as perhaps some empty 0s are required per row or column.
  • rowMajor / colMajor to indicate whether to load information from but in a row major or column major fashion (in practice, the values gl_CooperativeMatrixLayoutRowMajor or gl_CooperativeMatrixLayoutColumnMajor are used).

For instance, given a 16 rows x 8 columns matrix and a shared variable of 128 elements with initialized values ready:

    shared float16_t sharedVariable[128];
    coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> m;

Is the command below correct to load the 128 elements from the shared variable sharedVariable onto the matrix m so no element is missing (being all tightly loaded, with no “0.0” values due to stride)?
coopMatLoad(m, sharedVariable, 0, 8, gl_CooperativeMatrixLayoutRowMajor);

Thanks,
T