Deferred contexts and inheriting state from the immediate context
#1 Members - Reputation: 128
Posted 25 October 2012 - 08:39 AM
To test this, I created my deferred context using CreateDeferredContext() and then rendered a simple triangle strip with it.
Early on in my test application, I call OMSetRenderTargets() on the immediate context in order to render to the swap chain's back buffer. Now, after having read the documentation on MSDN about deferred contexts, I assumed that calling ExecuteCommandList() on the immediate context would execute all of the deferred commands as "an extension" to the commands that had already been executed on the immediate context, i.e. the triangle strip I rendered in the deferred context would be rendered to the swap chain's back buffer when I executed the generated command list on the immediate context.
That didn't seem to be the case, however. Instead, I had to manually pull out the immediate context's render target view (using OMGetRenderTargets()) and then set it on the deferred context with OMSetRenderTargets().
Am I doing something wrong or is that the way deferred contexts work?
#2 Members - Reputation: 3828
Posted 25 October 2012 - 10:16 AM
Immediate context state is cleared before and after a command list is executed. A command list has no concept of inheritance.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#3 Members - Reputation: 128
Posted 25 October 2012 - 06:45 PM
#4 Members - Reputation: 3828
Posted 26 October 2012 - 03:33 AM
Haha, I've been reading the docs up and down -- even sideways -- and I still missed this. I'm glad somebody else knows how to read.
I guess what threw me off is that the paragraph you linked is missing from ExecuteCommandList(), which is where it's most relevant, in my opinion.
A fault with the documentation is that info like this does tend to be scattered around, sometimes in the oddest places, yes.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.






