Unbinding Shader Resources and Render Targets in DirectX 10

Started by
1 comment, last by sirob 15 years, 11 months ago
Hi there, I'm gettting the following two messages in my DirectX 10 debug spew: [4744] D3D10: INFO: ID3D10Device::PSSetShaderResources: A currently bound PixelShader ShaderResourceView is being deleted; so naturally, will no longer be bound. [ STATE_SETTING INFO #43: PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT ] [4744] D3D10: INFO: ID3D10Device::OMSetRenderTargets: A currently bound RenderTargetView is being deleted; so naturally, will no longer be bound. [ STATE_SETTING INFO #49: OMSETRENDERTARGETS_UNBINDDELETINGOBJECT ] This is indicating that my rendering target and my shader resource are still bound to the pipeline. My question is, how do I unbind them from the pipeline before disposing them? I'm using C# and SlimDX, but I think this is a DirectX 10 issue and not a SlimDX issue...
Advertisement
ID3D10Device::ClearState

Restore all default device settings; return the device to the state it was in when it was created. This will set all set all input/output resource slots, shaders, input layouts, predications, scissor rectangles, depth-stencil state, rasterizer state, blend state, sampler state, and viewports to NULL. The primitive topology will be set to UNDEFINED.

and/or

D3DX10UnsetAllDeviceObjects

Removes all resources from the device by setting their pointers to NULL. This should be called during shutdown of your application. It helps ensure that when one is releasing all of their resources that none of them are bound to the device.

Note both messages are info messages. They're not saying anything is wrong, just letting you know something is happening.

If it doesn't bother you that this is happening, just let it happen.

If it bothers you for some reason, you can unset them by setting their values to NULL.

If this is happening when you're destroying your device, you can call ClearState or D3DX10UnsetAllDeviceObjects as XVincentX suggested, but this would have little actual impact on behavior.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement