Vulkan: Implement setUniform for matrices correctly

This fixes all these tests:
dEQP-GLES2.functional.shaders.functions.datatypes.float_mat*
dEQP-GLES2.functional.shaders.functions.datatypes.mat*
dEQP-GLES2.functional.shaders.linkage.varying_type_mat*
dEQP-GLES2.functional.shaders.matrix.*
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic.mat2_*
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic.mat3_*
dEQP-GLES2.functional.shaders.conversions.matrix_to_matrix.*
dEQP-GLES2.functional.shaders.conversions.matrix_combine.*
dEQP-GLES2.functional.shaders.random.scalar_conversion*

Bug:angleproject:2581
Bug:angleproject:2583
Bug:angleproject:2584
Bug:angleproject:2588
Change-Id: Ib8c03397f0229432292c51f4a6332f954fc8fa12
Reviewed-on: https://chromium-review.googlesource.com/1080392
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/renderer_utils.cpp b/src/libANGLE/renderer/renderer_utils.cpp
index c21ef6b..e2e3507 100644
--- a/src/libANGLE/renderer/renderer_utils.cpp
+++ b/src/libANGLE/renderer/renderer_utils.cpp
@@ -19,6 +19,7 @@
 #include "libANGLE/renderer/Format.h"
 
 #include <string.h>
+#include "common/utilities.h"
 
 namespace rx
 {
@@ -656,4 +657,29 @@
     return dirty;
 }
 
+template void GetMatrixUniform<GLint>(GLenum, GLint *, const GLint *, bool);
+template void GetMatrixUniform<GLuint>(GLenum, GLuint *, const GLuint *, bool);
+
+void GetMatrixUniform(GLenum type, GLfloat *dataOut, const GLfloat *source, bool transpose)
+{
+    int columns = gl::VariableColumnCount(type);
+    int rows    = gl::VariableRowCount(type);
+    for (GLint col = 0; col < columns; ++col)
+    {
+        for (GLint row = 0; row < rows; ++row)
+        {
+            GLfloat *outptr = dataOut + ((col * rows) + row);
+            const GLfloat *inptr =
+                transpose ? source + ((row * 4) + col) : source + ((col * 4) + row);
+            *outptr = *inptr;
+        }
+    }
+}
+
+template <typename NonFloatT>
+void GetMatrixUniform(GLenum type, NonFloatT *dataOut, const NonFloatT *source, bool transpose)
+{
+    UNREACHABLE();
+}
+
 }  // namespace rx