Creates a deferred context, which can record command lists.
HRESULT CreateDeferredContext( UINT ContextFlags, [out, optional] ID3D11DeviceContext **ppDeferredContext );
Reserved for future use. Pass 0.
- ppDeferredContext [out, optional]
Upon completion of the method, the passed pointer to an ID3D11DeviceContext interface pointer is initialized.
Returns S_OK if successful; otherwise, returns one of the following:
- Returns DXGI_ERROR_DEVICE_REMOVED if the video card has been physically removed from the system, or a driver upgrade for the video card has occurred. If this error occurs, you should destroy and recreate the device.
- Returns DXGI_ERROR_INVALID_CALL if the CreateDeferredContext method cannot be called from the current context. For example, if the device was created with the D3D11_CREATE_DEVICE_SINGLETHREADED value, CreateDeferredContext returns DXGI_ERROR_INVALID_CALL.
- Returns E_INVALIDARG if the ContextFlags parameter is invalid.
- Returns E_OUTOFMEMORY if the application has exhausted available memory.
A deferred context is a thread-safe context that you can use to record graphics commands on a thread other than the main rendering thread. Using a deferred context, you can record graphics commands into a command list that is encapsulated by the ID3D11CommandList interface. After all scene items are recorded, you can then submit them to the main render thread for final rendering. In this manner, you can perform rendering tasks concurrently across multiple threads and potentially improve performance in multi-core CPU scenarios.
You can create multiple deferred contexts.
For more information about deferred contexts, see Immediate and Deferred Rendering.
Windows Phone 8: This API is supported.