8#ifndef skgpu_graphite_DrawWriter_DEFINED
9#define skgpu_graphite_DrawWriter_DEFINED
18namespace DrawPassCommands {
84 fPrimitiveType =
type;
85 fVertexStride = vertexStride;
86 fInstanceStride = instanceStride;
97 size_t instanceStride()
const {
return fInstanceStride; }
98 size_t vertexStride()
const {
return fVertexStride; }
99 PrimitiveType primitiveType()
const {
return fPrimitiveType; }
166 template <
typename VertexCountProxy>
167 class DynamicInstances;
177 this->bindAndFlush(vertices, {}, {}, 0, vertexCount);
180 this->bindAndFlush(vertices, indices, {}, 0, indexCount);
185 this->bindAndFlush(vertices, {}, instances, vertexCount, instanceCount);
189 unsigned int instanceCount) {
191 this->bindAndFlush(vertices, indices, instances, indexCount, instanceCount);
203 size_t fVertexStride;
204 size_t fInstanceStride;
215 unsigned int fPendingCount;
216 unsigned int fPendingBase;
217 bool fPendingBufferBinds;
224 unsigned int templateCount,
unsigned int drawCount) {
227 this->setTemplate(vertices, indices, instances, SkTo<int>(templateCount));
229 fPendingCount = drawCount;
243 enum class Target { kVertices, kInstances };
288 reservedChunk.fOffset !=
296 fDrawer.fPendingBufferBinds =
true;
324 w.setTemplate(
w.fVertices, {}, {}, 0);
336 unsigned int vertexCount)
339 w.setTemplate(vertices, indices,
w.fInstances, SkTo<int>(vertexCount));
346template <
typename VertexCountProxy>
353 w.setTemplate(vertices, indices,
w.fInstances, -1);
359 this->updateTemplateCount();
364 template <
typename V>
370 fProxy << vertexCount;
375 void updateTemplateCount() {
376 const unsigned int count =
static_cast<unsigned int>(fProxy);
383 void onFlush()
override {
387 this->updateTemplateCount();
390 VertexCountProxy fProxy = {};
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void * reset(size_t size=0, OnShrink shrink=kAlloc_OnShrink)
std::pair< VertexWriter, BindBufferInfo > getVertexWriter(size_t requiredBytes)
void returnVertexBytes(size_t unusedBytes)
unsigned int fReservedCount
void reserve(unsigned int count)
Appender(DrawWriter &w, Target target)
VertexWriter append(unsigned int count)
~DynamicInstances() override
DynamicInstances(DrawWriter &w, BindBufferInfo vertices, BindBufferInfo indices)
VertexWriter append(const V &vertexCount, unsigned int instanceCount)
Instances(DrawWriter &w, BindBufferInfo vertices, BindBufferInfo indices, unsigned int vertexCount)
void drawIndexed(BindBufferInfo vertices, BindBufferInfo indices, unsigned int indexCount)
void drawInstanced(BindBufferInfo vertices, unsigned int vertexCount, BindBufferInfo instances, unsigned int instanceCount)
DrawWriter(DrawWriter &&)=delete
DrawWriter(const DrawWriter &)=delete
void draw(BindBufferInfo vertices, unsigned int vertexCount)
void drawIndexedInstanced(BindBufferInfo vertices, BindBufferInfo indices, unsigned int indexCount, BindBufferInfo instances, unsigned int instanceCount)
DrawWriter(DrawPassCommands::List *, DrawBufferManager *)
void newPipelineState(PrimitiveType type, size_t vertexStride, size_t instanceStride)
DrawBufferManager * bufferManager()
static float min(float r, float g, float b)
T __attribute__((ext_vector_type(N))) V
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
VertexWriter makeOffset(size_t offsetInBytes) const