[DirectX] Trouble eliminating D3D live object warnings

Started by
1 comment, last by forsandifs 12 years, 11 months ago
Here's the constructor and destructor for one of the classes I instance in my program:


CameraClass::CameraClass(D3DSysClass * pD3DSysPassed, CameraStruct * pCameraInfoPassed)
{
pCameraInfoConstBuff = new GPUConstantBufferClass(pD3DSysPassed, pCameraInfoPassed, sizeof(CameraStruct));
}

CameraClass::~CameraClass()
{
delete pCameraInfoConstBuff;
}


And here's the constructor and destructor for the GPUConstantBufferClass instanced in the above code:


GPUConstantBufferClass::GPUConstantBufferClass(D3DSysClass * pD3DSysPassed, void * pData, int StructSize)
{
pD3DSys = pD3DSysPassed;

D3D11_SUBRESOURCE_DATA SRData;
ZeroMemory(&SRData, sizeof(SRData));

SRData.pSysMem = pData;

D3D11_BUFFER_DESC BufferDesc;
ZeroMemory(&BufferDesc, sizeof(BufferDesc));

BufferDesc.Usage = D3D11_USAGE_DEFAULT;
BufferDesc.ByteWidth = StructSize;
BufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
BufferDesc.CPUAccessFlags = 0;

pD3DSys->pGetDevice()->CreateBuffer(&BufferDesc, &SRData, &pBuffer);
}

GPUConstantBufferClass::~GPUConstantBufferClass()
{
if(pBuffer != NULL){ pBuffer->Release(); pBuffer = NULL; }
}



The problem is that when I run the program I get the following Debug output:


D3D11: WARNING: Live Device: Name="unnamed", Addr=0x004F8008, ExtRef=1 [ STATE_CREATION WARNING #2097297: LIVE_DEVICE ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x004FD6A4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x004FD2CC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live RenderTargetView: Name="unnamed", Addr=0x004FBE8C, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097244: LIVE_RENDERTARGETVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x004FBBCC, ExtRef=4294967295, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live Query: Name="unnamed", Addr=0x02A6B1DC, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097280: LIVE_QUERY ]
D3D11: WARNING: Live Sampler: Name="unnamed", Addr=0x02A6B02C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097268: LIVE_SAMPLER ]
D3D11: WARNING: Live RasterizerState: Name="unnamed", Addr=0x02A6AE9C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097277: LIVE_RASTERIZERSTATE ]
D3D11: WARNING: Live DepthStencilState: Name="unnamed", Addr=0x02A6AD6C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097274: LIVE_DEPTHSTENCILSTATE ]
D3D11: WARNING: Live BlendState: Name="unnamed", Addr=0x02A6ABDC, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097271: LIVE_BLENDSTATE ]
D3D11: WARNING: Live Context: Name="unnamed", Addr=0x02A6006C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097226: LIVE_CONTEXT ]
D3D11: WARNING: Live Device Child Summary: Device Addr=0x004F8008
Using ID3D11Debug::ReportLiveDeviceObjects with D3D11_RLDO_DETAIL will help drill into object lifetimes. Objects with ExtRef=0 and IntRef=0 will be eventually destroyed through typical Immediate Context usage. However, if the application requires these objects to be destroyed sooner, ClearState followed by Flush on the Immediate Context will realize their destruction.
Live Context: 1
Live Buffer: 1
Live Texture1D: 0
Live Texture2D: 2
Live Texture3D: 0
Live ShaderResourceView: 0
Live RenderTargetView: 1
Live DepthStencilView: 0
Live VertexShader: 0
Live GeometryShader: 0
Live PixelShader: 0
Live InputLayout: 0
Live Sampler: 1
Live BlendState: 1
Live DepthStencilState: 1
Live RasterizerState: 1
Live Query: 1
Live Predicate: 0
Live Counter: 0
Live CommandList: 0
Live HullShader: 0
Live DomainShader: 0
Live ClassInstance: 0
Live ClassLinkage: 0
Live ComputeShader: 0
Live UnorderedAccessView: 0
[ STATE_CREATION WARNING #2097298: LIVE_OBJECT_SUMMARY ]



EDIT: I know it is that part of my code that is at fault because when I remove the " pCameraInfoConstBuff = new GPUConstantBufferClass(pD3DSysPassed, pCameraInfoPassed, sizeof(CameraStruct)); " line the warnings dissapear.

I know that they are not important warnings because the objects will get destroyed anyway, but I want to learn how to get rid of them properly. I have been scratching my head over this for quite a while now and cannot think of a way. Any help would be much appreciated.
Advertisement
Bump, for goodness!
Pretty please? :(

This topic is closed to new replies.

Advertisement