8#ifndef skgpu_graphite_BufferManager_DEFINED
9#define skgpu_graphite_BufferManager_DEFINED
26class DrawBufferManager;
57 bool isValid()
const {
return static_cast<bool>(fBuffer); }
60 explicit operator bool() {
return this->
isValid(); }
66 size_t size()
const {
return fSize; }
108 std::pair<VertexWriter, BindBufferInfo>
getVertexWriter(
size_t requiredBytes);
109 std::pair<IndexWriter, BindBufferInfo>
getIndexWriter(
size_t requiredBytes);
110 std::pair<UniformWriter, BindBufferInfo>
getUniformWriter(
size_t requiredBytes);
111 std::pair<UniformWriter, BindBufferInfo>
getSsboWriter(
size_t requiredBytes);
147 return SkAlignTo(dataSize, fCurrentBuffers[kUniformBufferIndex].fStartAlignment);
161 const size_t fStartAlignment;
162 const size_t fBlockSize;
167 void* fTransferMapPtr =
nullptr;
170 std::pair<
void* , BindBufferInfo> prepareMappedBindBuffer(BufferInfo*
info,
171 size_t requiredBytes,
172 std::string_view label);
173 BindBufferInfo prepareBindBuffer(BufferInfo*
info,
174 size_t requiredBytes,
175 std::string_view label,
176 bool supportCpuUpload =
false,
182 void onFailedBuffer();
185 const Caps*
const fCaps;
186 UploadBufferManager* fUploadManager;
188 static constexpr size_t kVertexBufferIndex = 0;
189 static constexpr size_t kIndexBufferIndex = 1;
190 static constexpr size_t kUniformBufferIndex = 2;
191 static constexpr size_t kStorageBufferIndex = 3;
192 static constexpr size_t kGpuOnlyStorageBufferIndex = 4;
193 static constexpr size_t kVertexStorageBufferIndex = 5;
194 static constexpr size_t kIndexStorageBufferIndex = 6;
195 static constexpr size_t kIndirectStorageBufferIndex = 7;
196 std::array<BufferInfo, 8> fCurrentBuffers;
214 bool fMappingFailed =
false;
264 std::string_view label)
const;
267 fTotalRequiredBytes = 0;
271 const size_t fAlignment;
273 std::vector<CopyRange> fData;
274 size_t fTotalRequiredBytes;
277 void* prepareStaticData(BufferInfo*
info,
size_t requiredBytes, BindBufferInfo*
target);
280 UploadBufferManager fUploadManager;
281 const size_t fRequiredTransferAlignment;
284 BufferInfo fVertexBufferInfo;
285 BufferInfo fIndexBufferInfo;
289 bool fMappingFailed =
false;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
BindBufferInfo getIndexStorage(size_t requiredBytes)
DrawBufferManager(ResourceProvider *, const Caps *, UploadBufferManager *)
ScratchBuffer getScratchStorage(size_t requiredBytes)
std::pair< void *, BindBufferInfo > getUniformPointer(size_t requiredBytes)
bool hasMappingFailed() const
std::pair< VertexWriter, BindBufferInfo > getVertexWriter(size_t requiredBytes)
std::pair< void *, BindBufferInfo > getStoragePointer(size_t requiredBytes)
std::pair< UniformWriter, BindBufferInfo > getUniformWriter(size_t requiredBytes)
std::pair< IndexWriter, BindBufferInfo > getIndexWriter(size_t requiredBytes)
BindBufferInfo getStorage(size_t requiredBytes, ClearBuffer cleared=ClearBuffer::kNo)
size_t alignUniformBlockSize(size_t dataSize)
void transferToRecording(Recording *)
std::pair< UniformWriter, BindBufferInfo > getSsboWriter(size_t requiredBytes)
void returnVertexBytes(size_t unusedBytes)
BindBufferInfo getIndirectStorage(size_t requiredBytes, ClearBuffer cleared=ClearBuffer::kNo)
BindBufferInfo getVertexStorage(size_t requiredBytes)
ScratchBuffer(ScratchBuffer &&)=default
ScratchBuffer & operator=(ScratchBuffer &&)=default
ScratchBuffer & operator=(const ScratchBuffer &)=delete
BindBufferInfo suballocate(size_t requiredBytes)
ScratchBuffer(const ScratchBuffer &)=delete
FinishResult finalize(Context *, QueueManager *, GlobalCache *)
VertexWriter getVertexWriter(size_t size, BindBufferInfo *binding)
StaticBufferManager(ResourceProvider *, const Caps *)
VertexWriter getIndexWriter(size_t size, BindBufferInfo *binding)
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