Specify CPU (buffer) and GPU (shader) types explicitly in Attribute
The CPU type is still specified using GrVertexAttribType.
The GPU type is specified directly using GrSLType.
kHalfX_GrVertexAttribType now really means half-float buffer
data, rather than float. (Caveat: The GL enum is only correct
with ES3/GL3 - ES2+extension needs a different value. Sigh.)
Bug: skia:
Change-Id: Ife101db68a5d4ea1ddc2f6c60fbec0c66d725c16
Reviewed-on: https://skia-review.googlesource.com/154628
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 099cc7e..04f73c8 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -226,9 +226,9 @@
SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
if (flags & kPerspective_DistanceFieldEffectFlag) {
- fInPosition = {"inPosition", kFloat3_GrVertexAttribType};
+ fInPosition = {"inPosition", kFloat3_GrVertexAttribType, kFloat3_GrSLType};
} else {
- fInPosition = {"inPosition", kFloat2_GrVertexAttribType};
+ fInPosition = {"inPosition", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
}
this->setVertexAttributeCnt(3);
@@ -837,9 +837,9 @@
SkASSERT(!(flags & ~kLCD_DistanceFieldEffectMask) && (flags & kUseLCD_DistanceFieldEffectFlag));
if (fFlags & kPerspective_DistanceFieldEffectFlag) {
- fInPosition = {"inPosition", kFloat3_GrVertexAttribType};
+ fInPosition = {"inPosition", kFloat3_GrVertexAttribType, kFloat3_GrSLType};
} else {
- fInPosition = {"inPosition", kFloat2_GrVertexAttribType};
+ fInPosition = {"inPosition", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
}
this->setVertexAttributeCnt(3);