Saving Vertex States With a StateBlock (Direct3D 9)

A state block can be used to capture only vertex state (see State Blocks Save and Restore State (Direct3D 9)). The following state is vertex state:

To capture vertex state with a state block, specify D3DSBT_VERTEXSTATE when calling IDirect3DDevice9::CreateStateBlock.

Vertex Pipeline: Render State

Device render states affect the behavior of almost every part of the pipeline. Render states are set by calling IDirect3DDevice9::SetRenderState.

The following table includes all render states that set-up vertex state:

Render StatesDefault Value
D3DRS_CULLMODED3DCULL_CCW
D3DRS_FOGCOLOR0
D3DRS_FOGTABLEMODED3DFOG_NONE
D3DRS_FOGSTART0
D3DRS_FOGEND1
D3DRS_FOGDENSITY1
D3DRS_RANGEFOGENABLEFALSE
D3DRS_AMBIENT0
D3DRS_COLORVERTEXTRUE
D3DRS_FOGVERTEXMODED3DFOG_NONE
D3DRS_CLIPPINGTRUE
D3DRS_LIGHTINGTRUE
D3DRS_LOCALVIEWERTRUE
D3DRS_EMISSIVEMATERIALSOURCED3DMCS_MATERIAL
D3DRS_AMBIENTMATERIALSOURCED3DMCS_MATERIAL
D3DRS_DIFFUSEMATERIALSOURCED3DMCS_COLOR1
D3DRS_SPECULARMATERIALSOURCED3DMCS_COLOR2
D3DRS_VERTEXBLENDD3DVBF_DISABLE
D3DRS_CLIPPLANEENABLE0
D3DRS_POINTSIZEDriver dependent
D3DRS_POINTSIZE_MIN1
D3DRS_POINTSPRITEENABLEFALSE
D3DRS_POINTSCALEENABLEFALSE
D3DRS_POINTSCALE_A1
D3DRS_POINTSCALE_B0
D3DRS_POINTSCALE_C0
D3DRS_MULTISAMPLEANTIALIASTRUE
D3DRS_MULTISAMPLEMASK0xffffffff
D3DRS_PATCHEDGESTYLED3DPATCHEDGE_DISCRETE
D3DRS_POINTSIZE_MAX1
D3DRS_INDEXEDVERTEXBLENDENABLEFALSE
D3DRS_TWEENFACTOR0
D3DRS_POSITIONDEGREED3DDEGREE_CUBIC
D3DRS_NORMALDEGREED3DDEGREE_LINEAR
D3DRS_MINTESSELLATIONLEVEL1
D3DRS_MAXTESSELLATIONLEVEL1
D3DRS_ADAPTIVETESS_X0
D3DRS_ADAPTIVETESS_Y0
D3DRS_ADAPTIVETESS_Z1
D3DRS_ADAPTIVETESS_W0
D3DRS_ENABLEADAPTIVETESSELLATION"/>FALSE

 

Vertex Pipeline: Sampler State

Sampler states control sampling related topics such as filtering, tiling, and texture coordinate address modes. Use IDirect3DDevice9::SetSamplerState to set up the sampler state (including the one used in the tessellator unit to sample displacement maps). The sampler states have been renamed with a "D3DSAMP_" prefix to enable compile time error detection when porting from DirectX 8.

The following table includes all sampler states that set-up vertex state:

Sampler StatesDefault Value
D3DSAMP_DMAPOFFSET256

 

Vertex Pipeline: Texture State

Texture states control texture blending operations of the multi-texture blender. Use IDirect3DDevice9::SetTextureStageState to set-up texture states. Use IDirect3DDevice9::SetTexture to associate a texture with a sampler stage.

The following table includes all the texture states that set-up vertex state:

Texture StatesDefault Value
D3DTSS_TEXCOORDINDEX0
D3DTSS_TEXTURETRANSFORMFLAGSD3DTTFF_DISABLE

 

D3DTSS_TEXCOORDINDEX is a fixed function vertex processing state. If a programmable vertex shader is used, this state is ignored.

Related topics

State Blocks Save and Restore State

 

 

Show: