Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: src/gpu/vk/GrVkPipelineStateDataManager.cpp

Issue 2129953002: Correctly handle mat2x2 in Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/shaderc.gyp ('k') | src/gpu/vk/GrVkUniformHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
};
« no previous file with comments | « gyp/shaderc.gyp ('k') | src/gpu/vk/GrVkUniformHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698