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

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

Issue 1755483002: Add support for 2x2 matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comments Created 4 years, 9 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 | « src/gpu/vk/GrVkProgramDataManager.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkUniformHandler.cpp
diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp
index 55b41abf49c64197489825dc4e02dacfdf38dedc..fff7dfe8739d46717ccba8c099f97d8f37344ddc 100644
--- a/src/gpu/vk/GrVkUniformHandler.cpp
+++ b/src/gpu/vk/GrVkUniformHandler.cpp
@@ -22,6 +22,7 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
0x7, // kVec2f_GrSLType
0xF, // kVec3f_GrSLType
0xF, // kVec4f_GrSLType
+ 0xF, // kMat22f_GrSLType
egdaniel 2016/03/07 18:51:26 so this function technically returns things in std
egdaniel 2016/03/07 21:20:03 Can you just make this change 0x7
Chris Dalton 2016/03/07 22:17:12 Done.
0xF, // kMat33f_GrSLType
0xF, // kMat44f_GrSLType
0x0, // Sampler2D_GrSLType, should never return this
@@ -32,10 +33,11 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
GR_STATIC_ASSERT(2 == kVec2f_GrSLType);
GR_STATIC_ASSERT(3 == kVec3f_GrSLType);
GR_STATIC_ASSERT(4 == kVec4f_GrSLType);
- GR_STATIC_ASSERT(5 == kMat33f_GrSLType);
- GR_STATIC_ASSERT(6 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
+ GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
+ GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
+ GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
+ GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
+ GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAlignments) == kGrSLTypeCount);
return kAlignments[type];
}
@@ -50,6 +52,7 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
2 * sizeof(float), // kVec2f_GrSLType
3 * sizeof(float), // kVec3f_GrSLType
4 * sizeof(float), // kVec4f_GrSLType
+ 8 * sizeof(float), // kMat22f_GrSLType
egdaniel 2016/03/07 18:51:26 This function may need some reworking since we hav
egdaniel 2016/03/07 21:20:03 Just add a comment after Mat22f_GrSLType saying so
Chris Dalton 2016/03/07 22:17:12 Done.
12 * sizeof(float), // kMat33f_GrSLType
16 * sizeof(float), // kMat44f_GrSLType
0, // kSampler2D_GrSLType
@@ -66,15 +69,16 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
GR_STATIC_ASSERT(2 == kVec2f_GrSLType);
GR_STATIC_ASSERT(3 == kVec3f_GrSLType);
GR_STATIC_ASSERT(4 == kVec4f_GrSLType);
- GR_STATIC_ASSERT(5 == kMat33f_GrSLType);
- GR_STATIC_ASSERT(6 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(10 == kBool_GrSLType);
- GR_STATIC_ASSERT(11 == kInt_GrSLType);
- GR_STATIC_ASSERT(12 == kUint_GrSLType);
- GR_STATIC_ASSERT(13 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
+ GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
+ GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
+ GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
+ GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
+ GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
+ GR_STATIC_ASSERT(11 == kBool_GrSLType);
+ GR_STATIC_ASSERT(12 == kInt_GrSLType);
+ GR_STATIC_ASSERT(13 == kUint_GrSLType);
+ GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrSLTypeCount);
}
« no previous file with comments | « src/gpu/vk/GrVkProgramDataManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698