Index: src/gpu/vk/GrVkPipelineStateDataManager.cpp |
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
index 9fa6d6dea2e7751249ee87d66014881578256209..5711df313207c73a7a616c2dda87aa12d524bba8 100644 |
--- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp |
@@ -233,12 +233,10 @@ template<int N> struct set_uniform_matrix { |
buffer = static_cast<char*>(buffer) + uniformOffset; |
for (int i = 0; i < count; ++i) { |
const float* matrix = &matrices[N * N * i]; |
- memcpy(buffer, &matrix[0], N * sizeof(float)); |
- buffer = static_cast<char*>(buffer) + 4*sizeof(float); |
- memcpy(buffer, &matrix[3], N * sizeof(float)); |
- buffer = static_cast<char*>(buffer) + 4*sizeof(float); |
- memcpy(buffer, &matrix[6], N * sizeof(float)); |
- buffer = static_cast<char*>(buffer) + 4*sizeof(float); |
+ for (int j = 0; j < N; ++j) { |
+ memcpy(buffer, &matrix[j * N], N * sizeof(float)); |
+ buffer = static_cast<char*>(buffer) + 4 * sizeof(float); |
+ } |
} |
} |
}; |