Sign in to follow this  
CastorX

d3d11 warnings

Recommended Posts

Hi! I've just created my first empty project in Direct3D11 with debug output enabled, but there is something strange... My CleanupDevice() function: /*================================================*/ void CleanupDevice() { if( d3dDeviceContext ) d3dDeviceContext->ClearState(); if( d3dDeviceContext ) d3dDeviceContext->Flush(); if( d3dRenderTargetView ) d3dRenderTargetView->Release(); if( d3dSwapChain ) d3dSwapChain->Release(); if( d3dDeviceContext ) d3dDeviceContext->Release(); #ifdef _DEBUG ID3D11Debug* d3dDebug = NULL; d3dDevice->QueryInterface( IID_ID3D11Debug, (VOID**)(&d3dDebug) ); if(d3dDebug != NULL) { d3dDebug->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL); d3dDebug->Release(); } #endif if( d3dDevice ) d3dDevice->Release(); } /*================================================*/ The output is: D3D11: INFO: Create Context: Name="unnamed", Addr=0x0395006C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097225: CREATE_CONTEXT ] D3D11: INFO: Create BlendState: Name="unnamed", Addr=0x0399269C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097270: CREATE_BLENDSTATE ] ... D3D11: WARNING: Live Device: Name="unnamed", Addr=0x00136640, ExtRef=2 [ STATE_CREATION WARNING #2097297: LIVE_DEVICE ] D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x03993084, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ] ... D3D11: INFO: Destroy Sampler: Name="unnamed", Addr=0x03992CD4 [ STATE_CREATION INFO #2097269: DESTROY_SAMPLER ] D3D11: INFO: Destroy Context: Name="unnamed", Addr=0x0395006C [ STATE_CREATION INFO #2097227: DESTROY_CONTEXT ] What does this mean? Any idea why these warnings are there?

Share this post


Link to post
Share on other sites
The INFO messages are just that, informational messages.

The "live device" warning row indicates that you have 2 outstanding references to the device object.

The debug object (ID3D11Debug) holds one reference to the device by itself, and you release it only after you call ReportLiveDeviceObjects (which prints the warnings). The device object itself is released even later.

As for the Texture2D, it could be the backbuffer or some other texture.

Share this post


Link to post
Share on other sites
OK, thank you, but, there is an another line:
D3D11: WARNING: Live RenderTargetView: Name="unnamed", Addr=0x03994AAC, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097244: LIVE_RENDERTARGETVIEW ]

No ExtRef or IntRef and is still in LIVE state???

Share this post


Link to post
Share on other sites
I don't think that objects are released the instant that all ref counts are zero, so it might just be pending deallocation.

The other possibility is that there is an SDKLayer bug that isn't setting the ref counts correctly -- I've seen this before with interfaces. Is it possible to pm me and send your code in so that we can take a look and see if it's a DX bug?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this