aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
Diffstat (limited to 'include/private')
-rw-r--r--include/private/GrTypesPriv.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index 5913a1e48c..efb9992f3d 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -696,7 +696,7 @@ static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
/**
* Returns the size of the attrib type in bytes.
*/
-static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
+static constexpr inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
switch (type) {
case kFloat_GrVertexAttribType:
return sizeof(float);
@@ -734,7 +734,11 @@ static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
case kUint_GrVertexAttribType:
return sizeof(uint32_t);
}
- SK_ABORT("Unexpected attribute type");
+ // GCC fails because SK_ABORT evaluates to non constexpr. clang and cl.exe think this is
+ // unreachable and don't complain.
+#if defined(__clang__) || !defined(__GNUC__)
+ SK_ABORT("Unsupported type conversion");
+#endif
return 0;
}