Post

Replies

Boosts

Views

Activity

How to release the texture from CVMetalTextureCacheCreateTextureFromImage created?
Hi I have create the texture using CVMetalTextureCacheCreateTextureFromImage, It's looks like return a UnsafeMutablePointer<CVMetalTexture?>, and I pass it to metal shader using CVMetalTextureGetTexture. use this way looks like have memory leak, how to release the texture is correct way? I tried call CVMetalTextureCacheFlush but it not working. Thanks Chengliang Part of code: var texture: CVMetalTexture? = nil let status = CVMetalTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, nil, pixelFormat, width, height, planeIndex, &texture) ... encoder.setTexture(CVMetalTextureGetTexture(self.texture), index: 0)
2
0
1.2k
Sep ’22