aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Ruiqi Mao <ruiqimao@google.com>2018-07-17 10:19:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-17 15:08:40 +0000
commitb609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec (patch)
tree052d6e5c5c7835481f5a0e0bead6ec575679b76f /include
parent6dd4b209091b876832218e8adf1909669960bf98 (diff)
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 <ruiqimao@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/private/GrTypesPriv.h82
1 files changed, 82 insertions, 0 deletions
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: