d3d11 warnings

Started by
2 comments, last by DieterVW 14 years ago
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?
Advertisement
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.

Niko Suni

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???
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?

This topic is closed to new replies.

Advertisement