| Index: include/gpu/GrTypesPriv.h
|
| diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
|
| index 8c7d6bda65150b6cd055a235f136077f4897c008..b527ab1bd77c7aa8079154af1d51add8e818ff95 100644
|
| --- a/include/gpu/GrTypesPriv.h
|
| +++ b/include/gpu/GrTypesPriv.h
|
| @@ -32,8 +32,10 @@ enum GrSLType {
|
| kBool_GrSLType,
|
| kInt_GrSLType,
|
| kUint_GrSLType,
|
| + kTexture2D_GrSLType,
|
| + kSampler_GrSLType,
|
|
|
| - kLast_GrSLType = kUint_GrSLType
|
| + kLast_GrSLType = kSampler_GrSLType
|
| };
|
| static const int kGrSLTypeCount = kLast_GrSLType + 1;
|
|
|
| @@ -78,7 +80,7 @@ static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1;
|
| */
|
| static inline int GrSLTypeVectorCount(GrSLType type) {
|
| SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
|
| - static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1 };
|
| + static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1 };
|
| return kCounts[type];
|
|
|
| GR_STATIC_ASSERT(0 == kVoid_GrSLType);
|
| @@ -96,6 +98,8 @@ static inline int GrSLTypeVectorCount(GrSLType type) {
|
| GR_STATIC_ASSERT(12 == kBool_GrSLType);
|
| GR_STATIC_ASSERT(13 == kInt_GrSLType);
|
| GR_STATIC_ASSERT(14 == kUint_GrSLType);
|
| + GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
|
| + GR_STATIC_ASSERT(16 == kSampler_GrSLType);
|
| GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount);
|
| }
|
|
|
| @@ -131,13 +135,15 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) {
|
| GR_STATIC_ASSERT(12 == kBool_GrSLType);
|
| GR_STATIC_ASSERT(13 == kInt_GrSLType);
|
| GR_STATIC_ASSERT(14 == kUint_GrSLType);
|
| - GR_STATIC_ASSERT(15 == kGrSLTypeCount);
|
| + GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
|
| + GR_STATIC_ASSERT(16 == kSampler_GrSLType);
|
| + GR_STATIC_ASSERT(17 == kGrSLTypeCount);
|
| }
|
|
|
| /** Is the shading language type integral (including vectors/matrices)? */
|
| static inline bool GrSLTypeIsIntType(GrSLType type) {
|
| SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
|
| - return type >= kInt_GrSLType;
|
| + return type >= kInt_GrSLType && type <= kUint_GrSLType;
|
|
|
| GR_STATIC_ASSERT(0 == kVoid_GrSLType);
|
| GR_STATIC_ASSERT(1 == kFloat_GrSLType);
|
| @@ -154,7 +160,9 @@ static inline bool GrSLTypeIsIntType(GrSLType type) {
|
| GR_STATIC_ASSERT(12 == kBool_GrSLType);
|
| GR_STATIC_ASSERT(13 == kInt_GrSLType);
|
| GR_STATIC_ASSERT(14 == kUint_GrSLType);
|
| - GR_STATIC_ASSERT(15 == kGrSLTypeCount);
|
| + GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
|
| + GR_STATIC_ASSERT(16 == kSampler_GrSLType);
|
| + GR_STATIC_ASSERT(17 == kGrSLTypeCount);
|
| }
|
|
|
| /** Is the shading language type numeric (including vectors/matrices)? */
|
| @@ -181,6 +189,8 @@ static inline size_t GrSLTypeSize(GrSLType type) {
|
| 0, // kBool_GrSLType
|
| 0, // kInt_GrSLType
|
| 0, // kUint_GrSLType
|
| + 0, // kTexture2D_GrSLType
|
| + 0, // kSampler_GrSLType
|
| };
|
| return kSizes[type];
|
|
|
| @@ -199,7 +209,9 @@ static inline size_t GrSLTypeSize(GrSLType type) {
|
| GR_STATIC_ASSERT(12 == kBool_GrSLType);
|
| GR_STATIC_ASSERT(13 == kInt_GrSLType);
|
| GR_STATIC_ASSERT(14 == kUint_GrSLType);
|
| - GR_STATIC_ASSERT(15 == kGrSLTypeCount);
|
| + GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
|
| + GR_STATIC_ASSERT(16 == kSampler_GrSLType);
|
| + GR_STATIC_ASSERT(17 == kGrSLTypeCount);
|
| }
|
|
|
| static inline bool GrSLTypeIs2DTextureType(GrSLType type) {
|
| @@ -222,7 +234,7 @@ static inline bool GrSLTypeIsSamplerType(GrSLType type) {
|
| }
|
|
|
| static inline bool GrSLTypeAcceptsPrecision(GrSLType type) {
|
| - return GrSLTypeIsNumeric(type) || GrSLTypeIsSamplerType(type);
|
| + return type != kVoid_GrSLType && type != kBool_GrSLType;
|
| }
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
| @@ -243,7 +255,7 @@ enum GrVertexAttribType {
|
|
|
| kInt_GrVertexAttribType,
|
| kUint_GrVertexAttribType,
|
| -
|
| +
|
| kLast_GrVertexAttribType = kUint_GrVertexAttribType
|
| };
|
| static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
|
|
|