Jump to content
  • Advertisement
Sign in to follow this  
Limmy

DX11 State blocks in Direct3D 11

This topic is 2616 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

[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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!