36 if (mtlSpec.
fUsage & MTLTextureUsageRenderTarget &&
50 sk_cfp<MTLTextureDescriptor*>
desc([[MTLTextureDescriptor alloc]
init]);
51 (*desc).textureType = (
info.numSamples() > 1) ? MTLTextureType2DMultisample : MTLTextureType2D;
52 (*desc).pixelFormat = (MTLPixelFormat)mtlSpec.
fFormat;
56 (*desc).mipmapLevelCount = numMipLevels;
57 (*desc).sampleCount =
info.numSamples();
58 (*desc).arrayLength = 1;
59 (*desc).usage = mtlSpec.
fUsage;
60 (*desc).storageMode = (MTLStorageMode)mtlSpec.
fStorageMode;
99 sk_cfp<id<MTLTexture>>
texture) {
108void MtlTexture::freeGpuData() {
113void MtlTexture::setBackendLabel(
char const* label) {
115#ifdef SK_ENABLE_MTL_DEBUG_INFO
116 NSString* labelStr = @(label);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static int ComputeLevelCount(int baseWidth, int baseHeight)
bool isTexturable(const TextureInfo &) const
virtual bool isStorage(const TextureInfo &) const =0
virtual bool isRenderable(const TextureInfo &) const =0
int maxTextureSize() const
static sk_sp< Texture > Make(const MtlSharedContext *, SkISize dimensions, const TextureInfo &, skgpu::Budgeted)
static sk_cfp< id< MTLTexture > > MakeMtlTexture(const MtlSharedContext *, SkISize dimensions, const TextureInfo &)
static sk_sp< Texture > MakeWrapped(const MtlSharedContext *, SkISize dimensions, const TextureInfo &, sk_cfp< id< MTLTexture > >)
id< MTLTexture > mtlTexture() const
skgpu::Budgeted budgeted() const
const SharedContext * sharedContext() const
const Caps * caps() const
SkISize dimensions() const
bool MtlFormatIsDepthOrStencil(MTLPixelFormat format)
constexpr int32_t width() const
constexpr int32_t height() const
MtlStorageMode fStorageMode