D3D10CreateStateBlock function (d3d10effect.h)
Create a state block.
HRESULT D3D10CreateStateBlock( [in] ID3D10Device *pDevice, [in] D3D10_STATE_BLOCK_MASK *pStateBlockMask, [out] ID3D10StateBlock **ppStateBlock );
The device for which the state block will be created.
Address of a pointer to the buffer created (see ID3D10StateBlock Interface).
This method returns one of the following Direct3D 10 Return Codes.
A state block is a collection of device state, and is used for saving and restoring device state. Use a state-block mask to enable subsets of state for saving and restoring.
The D3D10_STATE_BLOCK_MASK structure can be filled manually or by using any of the D3D10StateBlockMaskXXX APIs. A state block mask can also be obtained by calling ID3D10EffectTechnique::ComputeStateBlockMask or ID3D10EffectPass::ComputeStateBlockMask.
Differences between Direct3D 9 and Direct3D 10:
In Direct3D 10, a state block object does not contain any valid information about the state of the device until ID3D10StateBlock::Capture is called. In Direct3D 9, state is saved in a state block object, when it is created.