29static constexpr Attribute kSsboIndexAttr =
32static constexpr Attribute kAttributePositionOnly[] =
33 {kPositionAttr, kSsboIndexAttr};
34static constexpr Attribute kAttributeColor[] =
35 {kPositionAttr, kColorAttr, kSsboIndexAttr};
36static constexpr Attribute kAttributeTexCoords[] =
37 {kPositionAttr, kTexCoordAttr, kSsboIndexAttr};
38static constexpr Attribute kAttributeColorAndTexCoords[] =
39 {kPositionAttr, kColorAttr, kTexCoordAttr, kSsboIndexAttr};
42 kAttributePositionOnly,
45 kAttributeColorAndTexCoords,
48static constexpr Varying kVaryingColor[] =
72 variant_name(
type, hasColor, hasTexCoords),
73 hasColor ?
Flags::kEmitsPrimitiveColor |
Flags::kPerformsShading
74 :
Flags::kPerformsShading,
83 , fHasTexCoords(hasTexCoords) {}
88 if (fHasColor && fHasTexCoords) {
90 color = half4(vertColor.bgr * vertColor.a, vertColor.a);
91 float4 devPosition = localToDevice * float4(position, 0.0, 1.0);
92 devPosition.z = depth;
93 stepLocalCoords = texCoords;
95 } else if (fHasTexCoords) {
97 float4 devPosition = localToDevice * float4(position, 0.0, 1.0);
98 devPosition.z = depth;
99 stepLocalCoords = texCoords;
101 } else if (fHasColor) {
103 color = half4(vertColor.bgr * vertColor.a, vertColor.a);
104 float4 devPosition = localToDevice * float4(position, 0.0, 1.0);
105 devPosition.z = depth;
106 stepLocalCoords = position;
110 float4 devPosition = localToDevice * float4(position, 0.0, 1.0);
111 devPosition.z = depth;
112 stepLocalCoords = position;
119 return "primitiveColor = color;\n";
129 const int vertexCount =
info.vertexCount();
130 const int indexCount =
info.indexCount();
132 const uint16_t* indices =
info.indices();
149 verts.reserve(indices ? indexCount : vertexCount);
153 while (vertProc(&
state)) {
154 verts.append(3) << positions[
state.f0]
160 << positions[
state.f1]
166 << positions[
state.f2]
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorTRANSPARENT
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static constexpr bool SkToBool(const T &x)
SkSpan< const Uniform > uniforms() const
void writeVertices(DrawWriter *writer, const DrawParams ¶ms, skvx::ushort2 ssboIndices) const override
const char * fragmentColorSkSL() const override
std::string vertexSkSL() const override
~VerticesRenderStep() override
VerticesRenderStep(PrimitiveType, bool hasColor, bool hasTexCoords)
void writeUniformsAndTextures(const DrawParams &, PipelineDataGatherer *) const override
const EmbeddedViewParams * params
PODArray< SkColor > colors
DEF_SWITCHES_START aot vmservice shared library name
static const std::map< std::string, VerticesBuilder::AttributeType > kAttributes
static constexpr DepthStencilSettings kDirectDepthGEqualPass
bool(* Proc)(VertState *)
static Conditional< T > If(bool condition, const T &value)