mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
fix: remaining memory leaks
This commit is contained in:
parent
23af64ade8
commit
7731787aa2
4 changed files with 5 additions and 1 deletions
|
@ -70,6 +70,7 @@ struct RenderTarget {
|
|||
descriptor->setStorageMode(MTL::StorageModePrivate);
|
||||
texture = device->newTexture(descriptor);
|
||||
texture->setLabel(toNSString(std::string(std::is_same<Format_t, PICA::ColorFmt>::value ? "Color" : "Depth") + " render target " + std::to_string(size.u()) + "x" + std::to_string(size.v())));
|
||||
descriptor->release();
|
||||
}
|
||||
|
||||
void free() {
|
||||
|
|
|
@ -103,6 +103,8 @@ class RendererMTL final : public Renderer {
|
|||
lastColorTexture = colorTexture;
|
||||
lastDepthTexture = depthTexture;
|
||||
}
|
||||
|
||||
renderPassDescriptor->release();
|
||||
}
|
||||
|
||||
void commitCommandBuffer() {
|
||||
|
|
|
@ -18,6 +18,7 @@ void Texture::allocate() {
|
|||
descriptor->setStorageMode(MTL::StorageModeShared); // TODO: use private + staging buffers?
|
||||
texture = device->newTexture(descriptor);
|
||||
texture->setLabel(toNSString("Texture " + std::to_string(size.u()) + "x" + std::to_string(size.v())));
|
||||
descriptor->release();
|
||||
|
||||
setNewConfig(config);
|
||||
}
|
||||
|
@ -43,6 +44,7 @@ void Texture::setNewConfig(u32 cfg) {
|
|||
|
||||
samplerDescriptor->setLabel(toNSString("Sampler"));
|
||||
sampler = device->newSamplerState(samplerDescriptor);
|
||||
samplerDescriptor->release();
|
||||
}
|
||||
|
||||
void Texture::free() {
|
||||
|
|
|
@ -86,7 +86,6 @@ void RendererMTL::display() {
|
|||
|
||||
nextRenderPassName = "Display";
|
||||
beginRenderPassIfNeeded(renderPassDescriptor, false, drawable->texture());
|
||||
renderPassDescriptor->release();
|
||||
renderCommandEncoder->setRenderPipelineState(displayPipeline);
|
||||
renderCommandEncoder->setFragmentSamplerState(nearestSampler, 0);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue