From b609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec Mon Sep 17 00:00:00 2001 From: Ruiqi Mao Date: Tue, 17 Jul 2018 10:19:38 -0400 Subject: added byte and ubyte types to SKSL created new GMs for skinning Bug: skia: Change-Id: I15fb2bd02fba8beb6dd2dd3f3716da016ea92192 Reviewed-on: https://skia-review.googlesource.com/140241 Commit-Queue: Ruiqi Mao Reviewed-by: Brian Osman Reviewed-by: Ethan Nicholas --- include/private/GrTypesPriv.h | 82 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'include') diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index 1490574193..ee6bfd8097 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -289,6 +289,14 @@ GrAAType GrChooseAAType(GrAA, GrFSAAType, GrAllowMixedSamples, const GrCaps&); enum GrSLType { kVoid_GrSLType, kBool_GrSLType, + kByte_GrSLType, + kByte2_GrSLType, + kByte3_GrSLType, + kByte4_GrSLType, + kUByte_GrSLType, + kUByte2_GrSLType, + kUByte3_GrSLType, + kUByte4_GrSLType, kShort_GrSLType, kShort2_GrSLType, kShort3_GrSLType, @@ -389,6 +397,14 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) { case kTexture2DRectSampler_GrSLType: case kBufferSampler_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kByte2_GrSLType: + case kByte3_GrSLType: + case kByte4_GrSLType: + case kUByte_GrSLType: + case kUByte2_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: case kShort_GrSLType: case kShort2_GrSLType: case kShort3_GrSLType: @@ -417,6 +433,8 @@ static inline int GrSLTypeVecLength(GrSLType type) { case kFloat_GrSLType: case kHalf_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kUByte_GrSLType: case kShort_GrSLType: case kUShort_GrSLType: case kInt_GrSLType: @@ -425,6 +443,8 @@ static inline int GrSLTypeVecLength(GrSLType type) { case kFloat2_GrSLType: case kHalf2_GrSLType: + case kByte2_GrSLType: + case kUByte2_GrSLType: case kShort2_GrSLType: case kUShort2_GrSLType: case kInt2_GrSLType: @@ -433,6 +453,8 @@ static inline int GrSLTypeVecLength(GrSLType type) { case kFloat3_GrSLType: case kHalf3_GrSLType: + case kByte3_GrSLType: + case kUByte3_GrSLType: case kShort3_GrSLType: case kUShort3_GrSLType: case kInt3_GrSLType: @@ -440,6 +462,8 @@ static inline int GrSLTypeVecLength(GrSLType type) { case kFloat4_GrSLType: case kHalf4_GrSLType: + case kByte4_GrSLType: + case kUByte4_GrSLType: case kShort4_GrSLType: case kUShort4_GrSLType: case kInt4_GrSLType: @@ -494,6 +518,14 @@ static inline bool GrSLTypeIs2DCombinedSamplerType(GrSLType type) { case kUint2_GrSLType: case kBufferSampler_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kByte2_GrSLType: + case kByte3_GrSLType: + case kByte4_GrSLType: + case kUByte_GrSLType: + case kUByte2_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: case kShort_GrSLType: case kShort2_GrSLType: case kShort3_GrSLType: @@ -540,6 +572,14 @@ static inline bool GrSLTypeIsCombinedSamplerType(GrSLType type) { case kUint_GrSLType: case kUint2_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kByte2_GrSLType: + case kByte3_GrSLType: + case kByte4_GrSLType: + case kUByte_GrSLType: + case kUByte2_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: case kShort_GrSLType: case kShort2_GrSLType: case kShort3_GrSLType: @@ -568,6 +608,14 @@ static inline bool GrSLTypeAcceptsPrecision(GrSLType type) { case kVoid_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kByte2_GrSLType: + case kByte3_GrSLType: + case kByte4_GrSLType: + case kUByte_GrSLType: + case kUByte2_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: case kShort_GrSLType: case kShort2_GrSLType: case kShort3_GrSLType: @@ -638,6 +686,14 @@ static inline bool GrSLTypeTemporarilyAcceptsPrecision(GrSLType type) { case kVoid_GrSLType: case kBool_GrSLType: + case kByte_GrSLType: + case kByte2_GrSLType: + case kByte3_GrSLType: + case kByte4_GrSLType: + case kUByte_GrSLType: + case kUByte2_GrSLType: + case kUByte3_GrSLType: + case kUByte4_GrSLType: case kShort2_GrSLType: case kShort3_GrSLType: case kShort4_GrSLType: @@ -669,6 +725,16 @@ enum GrVertexAttribType { kInt3_GrVertexAttribType, // vector of 3 32-bit ints kInt4_GrVertexAttribType, // vector of 4 32-bit ints + + kByte_GrVertexAttribType, // signed byte + kByte2_GrVertexAttribType, // vector of 2 8-bit signed bytes + kByte3_GrVertexAttribType, // vector of 3 8-bit signed bytes + kByte4_GrVertexAttribType, // vector of 4 8-bit signed bytes + kUByte_GrVertexAttribType, // unsigned byte + kUByte2_GrVertexAttribType, // vector of 2 8-bit unsigned bytes + kUByte3_GrVertexAttribType, // vector of 3 8-bit unsigned bytes + kUByte4_GrVertexAttribType, // vector of 4 8-bit unsigned bytes + kUByte_norm_GrVertexAttribType, // unsigned byte, e.g. coverage, 0 -> 0.0f, 255 -> 1.0f. kUByte4_norm_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors, 0 -> 0.0f, // 255 -> 1.0f. @@ -719,6 +785,22 @@ static inline GrSLType GrVertexAttribTypeToSLType(GrVertexAttribType type) { return kInt3_GrSLType; case kInt4_GrVertexAttribType: return kInt4_GrSLType; + case kByte_GrVertexAttribType: + return kByte_GrSLType; + case kByte2_GrVertexAttribType: + return kByte_GrSLType; + case kByte3_GrVertexAttribType: + return kByte_GrSLType; + case kByte4_GrVertexAttribType: + return kByte4_GrSLType; + case kUByte_GrVertexAttribType: + return kUByte_GrSLType; + case kUByte2_GrVertexAttribType: + return kUByte_GrSLType; + case kUByte3_GrVertexAttribType: + return kUByte_GrSLType; + case kUByte4_GrVertexAttribType: + return kUByte4_GrSLType; case kInt_GrVertexAttribType: return kInt_GrSLType; case kUint_GrVertexAttribType: -- cgit v1.2.3