8#ifndef skgpu_graphite_render_DynamicInstancesPatchAllocator_DEFINED
9#define skgpu_graphite_render_DynamicInstancesPatchAllocator_DEFINED
22template <
typename FixedCountVariant>
33 unsigned int reserveCount)
34 : fInstances(writer, fixedVertexBuffer, fixedIndexBuffer) {
35 SkASSERT(stride == writer.instanceStride());
38 fInstances.
reserve(reserveCount);
42 return fInstances.
append(tolerances, 1);
46 struct LinearToleranceProxy {
47 operator unsigned int()
const {
return FixedCountVariant::VertexCount(fTolerances); }
50 tess::LinearTolerances fTolerances;
53 DrawWriter::DynamicInstances<LinearToleranceProxy> fInstances;
void reserve(unsigned int count)
VertexWriter append(const V &vertexCount, unsigned int instanceCount)
VertexWriter append(const tess::LinearTolerances &tolerances)
DynamicInstancesPatchAllocator(size_t stride, DrawWriter &writer, BindBufferInfo fixedVertexBuffer, BindBufferInfo fixedIndexBuffer, unsigned int reserveCount)
VertexWriter & operator<<(VertexWriter &w, const T &val)