DX11 Obj reference count problem.

raptor16

30-06-2012 17:30:22

A little problem, since there will be problem on Swpachain::ResizeBuffers.

[MyGUI_DirectX11RTTexture.cpp] OMGetRenderTargets will increase reference count . Just release it .


Or just do not Get & Set back RenderTargets, mostly no problem.

Altren

30-06-2012 21:48:48

Am I right, that adding this two if's would be enough?
void DirectX11RTTexture::end()
{
mManager->mpD3DContext->OMSetRenderTargets(1, &oldRenderTarget, oldDepthStencil);
if (oldRenderTarget)
{
oldRenderTarget->Release();
oldRenderTarget = nullptr;
}
if (oldDepthStencil)
{
oldDepthStencil->Release();
oldDepthStencil = nullptr;
}
mManager->mpD3DContext->RSSetViewports(1, &oldViewport);
}

raptor16

01-07-2012 04:15:58

It is OK

Better add "oldRenderTarget(nullptr),oldDepthStencil(nullptr)" in the initialization list .

Altren

01-07-2012 11:26:14

Done.