Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explicitly Release Metal Texture

Tags:

metal

Simple question that I can't find an answer to, On openGL there is a glDeleteTextures(1, &t) Obviously the model is quite drastically different but i'm wondering if Metal has the same need or requirement.

Are MTLTexture's just released via reference counting or is there another way to release the texture and let the GPU clear it out of its caches as well?

like image 664
utahwithak Avatar asked Dec 06 '25 06:12

utahwithak


1 Answers

MTLTexture lifetimes are managed exactly like other objects: they are dealloc'ed when their refcount reaches 0 (whether that happens automatically with ARC/Swift or MRR under Obj-C). Objects that use textures, like command buffers, may retain textures while they are in use, affecting their lifetime, but most applications can happily ignore this.

like image 183
warrenm Avatar answered Dec 11 '25 23:12

warrenm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!