I would find it really useful to compile with -Zpc, as it removes the need to transpose matrices in the framework (platform independent OpenGL and DX), or even worse, in user code.
The restriction that this only works with square matrices is a bit of a show stopper though.
The corresponding comment in spirv_glsl.cpp indicates that this restriction could potentially be lifted:
// Only square row-major matrices can be converted at this time.
// Converting non-square matrices will require defining custom GLSL function that
// swaps matrix elements while retaining the original dimensional form of the matrix.
const auto mbr_type = get<SPIRType>(type.member_types[index]);
if (mbr_type.columns != mbr_type.vecsize)
SPIRV_CROSS_THROW("Row-major matrices must be square on this platform.");
Would this have a negative impact on performance, or would you expect this extra function to get optimized out in the end anyway?
I would find it really useful to compile with -Zpc, as it removes the need to transpose matrices in the framework (platform independent OpenGL and DX), or even worse, in user code.
The restriction that this only works with square matrices is a bit of a show stopper though.
The corresponding comment in spirv_glsl.cpp indicates that this restriction could potentially be lifted:
Would this have a negative impact on performance, or would you expect this extra function to get optimized out in the end anyway?