State blocks in Direct3D 11

Started by
4 comments, last by _the_phantom_ 12 years, 11 months ago
[font="Verdana"]Hi,[/font]
[font="Verdana"]
[/font]
[font="Verdana"]As the (sub)topic suggests, I'm just wondering how state blocks are handled in Direct3D 11. With Direct3D 10, there was [/font][size=2][font="'Courier New"]D3D10CreateStateBlock[/font][font="Verdana"], and then the returned [/font][size=2][font="'Courier New"]ID3D10StateBlock[/font][font="Verdana"] interface to capture the current device state, and reset once modifications have been made, for lets say, a Sprite class. These functions/interfaces don't seem to exist in Direct3D 11, D3DX11, or the separate Effects11 source.[/font]
[size=2][font="Verdana"]
[/font]
[size=2][font="Verdana"]Could anyone give me some pointers? :-)[/font]
[size=2][font="Verdana"]
[/font]
[size=2][font="Verdana"]Thanks![/font]
Advertisement
I'm not positive, but I believe ID3D11DeviceContext can record a series of state commands, and then execute them. So maybe ID3D11DeviceContext makes ID3D10StateBlock redundant.
-----Quat
Thanks for your post, Quat.

Looking at the ID3D11DeviceContext Interface Reference, I can't see any methods that stand out that would have similar usage to state blocks. Does anyone have an example?

Thanks

Thanks for your post, Quat.

Looking at the ID3D11DeviceContext Interface Reference, I can't see any methods that stand out that would have similar usage to state blocks. Does anyone have an example?

Thanks


Maybe ID3D11DeviceContext::FinishCommandList and ID3D11CommandList.
-----Quat
There's really no need for the D3D9-style state blocks since states are already divided into state blocks. If you needed it, you could really easily make your own device state block class that just pulls off the rasterizer, depth stencil, blend, and sampler state interfaces from the device context and then re-sets them.

[quote name='Limmy' timestamp='1305911501' post='4813538']
Thanks for your post, Quat.

Looking at the ID3D11DeviceContext Interface Reference, I can't see any methods that stand out that would have similar usage to state blocks. Does anyone have an example?

Thanks


Maybe ID3D11DeviceContext::FinishCommandList and ID3D11CommandList.
[/quote]

This isn't the same as state blocks; this functionality lets you record D3D commands, typically from multiple threads, for later play back on the main context to render. While state is recorded it is not the same.

As MJP says states are already divided up into 'blocks' which can be setup as required and then set on the context when drawing. Between that and constant buffers state setting is considerably better in D3D11 than previous versions so I would learn how the new system works and move away from the old way of thinking.

This topic is closed to new replies.

Advertisement