Graphics Reference
In-Depth Information
The process is outlined in the following diagram:
Rendering across multiple deferred contexts
While setting up the deferred context, it is necessary to configure the pipeline state as
you would for the immediate context. The deferred context begins with a default state,
the equivalent of when the DeviceContext.ClearState method is called. When we create
the SharpDX.Direct3D11.CommandList instance via a call to the DeviceContext.
FinishComandList(bool restoreState) instance, we are passing in the true value
so that the context's state remains as we have set it; otherwise, it reverts to its default state.
Conversely, the immediateContext.ExecuteCommandList method is passed a false
value because we don't need to preserve the immediate context state.
Passing true to either DeviceContext.FinishCommandList
or DeviceContext.ExecuteCommandList can potentially
degrade the performance by introducing avoidable and inefficient
state transitions. In order to throw away the current state, we need
to call something similar to the InitializeContext method for
each deferred context on every frame (or rendering pass).
Each context can have a different state applied depending on its purpose; in fact, this might be
a convenient way of separating pipeline states for your rendering logic, for example, a deferred
context with a different render target for shadow mapping, another for a lighting pass, and so
on. Another example may be of a deferred context that is to be used only for preparing compute
shaders in which there may be no need to set a viewport and render a target.
Multithreaded rendering performance as compared to single threaded (higher is better). Results with an AMD®
Radeon HD 7950 on an Intel® i7-3770K.
 
Search WWH ::




Custom Search