8#ifndef GrMtlBuffer_DEFINED
9#define GrMtlBuffer_DEFINED
14#import <Metal/Metal.h>
28 id<MTLBuffer>
mtlBuffer()
const {
return fMtlBuffer; }
35 std::string_view label);
44 bool onClearToZero()
override;
46 bool onUpdateData(
const void*
src,
size_t offset,
size_t size,
bool preserve)
override;
49 void internalUnmap(
size_t writtenOffset,
size_t writtenSize);
52 void validate()
const;
55 void onSetLabel()
override;
58 id<MTLBuffer> fMtlBuffer;
size_t size() const final
GrGpuBuffer(GrGpu *, size_t sizeInBytes, GrGpuBufferType, GrAccessPattern, std::string_view label)
GrGpuBufferType intendedType() const
GrMtlBuffer(GrMtlGpu *, size_t size, GrGpuBufferType intendedType, GrAccessPattern, std::string_view label)
void onRelease() override
static sk_sp< GrMtlBuffer > Make(GrMtlGpu *, size_t size, GrGpuBufferType intendedType, GrAccessPattern)
void onAbandon() override
id< MTLBuffer > mtlBuffer() const