Permalink
Browse files

GPU: Properly Release() FBOs.

In case we end up wanting to use those reference counts, let's use the
right API.
  • Loading branch information...
unknownbrackets committed Nov 5, 2017
1 parent 2f305f9 commit 78b5565035763e05acdb28733788e9a986e816a0
@@ -198,7 +198,7 @@ bool FramebufferManagerCommon::ShouldDownloadFramebuffer(const VirtualFramebuffe
void FramebufferManagerCommon::SetNumExtraFBOs(int num) {
for (size_t i = 0; i < extraFBOs_.size(); i++) {
delete extraFBOs_[i];
extraFBOs_[i]->Release();
}
extraFBOs_.clear();
for (int i = 0; i < num; i++) {
@@ -620,7 +620,7 @@ void FramebufferManagerCommon::NotifyRenderFramebufferSwitched(VirtualFramebuffe
if (vfb->fbo) {
// This should only happen very briefly when toggling useBufferedRendering_.
textureCache_->NotifyFramebuffer(vfb->fb_address, vfb, NOTIFY_FB_DESTROYED);
delete vfb->fbo;
vfb->fbo->Release();
vfb->fbo = nullptr;
}
@@ -1173,7 +1173,7 @@ void FramebufferManagerCommon::ResizeFramebufFBO(VirtualFramebuffer *vfb, int w,
if (!useBufferedRendering_) {
if (vfb->fbo) {
delete vfb->fbo;
vfb->fbo->Release();
vfb->fbo = nullptr;
}
return;
@@ -781,7 +781,7 @@ void TextureCacheCommon::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFram
nextTexture_ = entry;
} else {
if (framebuffer->fbo) {
delete framebuffer->fbo;
framebuffer->fbo->Release();
framebuffer->fbo = nullptr;
}
Unbind();
@@ -738,7 +738,7 @@ void FramebufferManagerD3D11::DestroyAllFBOs() {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();
@@ -131,7 +131,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
drawPixelsTex_->Release();
}
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
for (auto it = offscreenSurfaces_.begin(), end = offscreenSurfaces_.end(); it != end; ++it) {
it->second.surface->Release();
@@ -726,7 +726,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();
@@ -777,7 +777,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
success = GetRenderTargetFramebuffer(renderTarget, offscreen, w, h, buffer);
}
if (tempFBO) {
delete tempFBO;
tempFBO->Release();
}
}
@@ -254,7 +254,7 @@ FramebufferManagerGLES::~FramebufferManagerGLES() {
SetNumExtraFBOs(0);
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
delete [] pixelBufObj_;
@@ -1048,7 +1048,7 @@ void FramebufferManagerGLES::DestroyAllFBOs() {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();

0 comments on commit 78b5565

Please sign in to comment.