diff options
author | Brian Salomon <bsalomon@google.com> | 2018-06-18 12:52:47 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-18 17:13:58 +0000 |
commit | 19c1233c447f625c2522e7ecd0a0adecc629bb2f (patch) | |
tree | 891e06143986ade3aae8d4176ec8b426f70b896f /include/private | |
parent | 146cf3ce7935019ecc63ce9e93450a8c122880d8 (diff) |
Change how vertex/instance attributes are handled in geometry processors.
* No longer register vertex/instance attributes on base class, just counts
* Separate instance and vertex attributes and remove InputRate and offset
* Make attributes constexpr where possible
Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
Reviewed-on: https://skia-review.googlesource.com/132405
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/GrTypesPriv.h | 8 |
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; } |