Add two utility matrix functions.

The first returns the number of components in a matrix column/row, and the second the number of columns/rows in matrix uniforms.

TRAC #23083

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Authored-by: Jamie Madill
diff --git a/src/common/utilities.cpp b/src/common/utilities.cpp
index 1ee5598..ad03250 100644
--- a/src/common/utilities.cpp
+++ b/src/common/utilities.cpp
@@ -270,6 +270,18 @@
     }
 }
 
+int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix)
+{
+    ASSERT(IsMatrixType(type));
+    return isRowMajorMatrix ? VariableRowCount(type) : VariableColumnCount(type);
+}
+
+int MatrixComponentCount(GLenum type, bool isRowMajorMatrix)
+{
+    ASSERT(IsMatrixType(type));
+    return isRowMajorMatrix ? VariableColumnCount(type) : VariableRowCount(type);
+}
+
 int AttributeRegisterCount(GLenum type)
 {
     return IsMatrixType(type) ? VariableColumnCount(type) : 1;