Hi All,
Why do GLSL matrices use row-major layout with the HLSL backend?
GLSL uses column-major layout by default. HLSL uses column-major layout by default, AFAIK.
So why is ANGLE emitting a bunch of row-major layout code?
For example, this is from some HLSL output from a dumped shader:
#pragma pack_matrix(row_major)
struct rm__PerObjectVertUniformsStruct
{
float4x4 _model_matrix;
//...
};
Because of this row-major storage, in the HLSL shader it then has to compute the transpose of matrices:
_pos_ws = mul(transpose(_model_skin_matrix5659), vec4_ctor(_final_pos_os5661, 1.0)).xyz);
This seems like a needless addition of uneeded work done.
So why use row-major at all?
Thanks,
Nick C.