Microsoft DirectX 8.1 (C++)

D3DVSD_CONST

Loads data into the vertex shader constant memory.

D3DVSD_CONST( _ConstantAddress, _Count ) \
            (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \
            ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress))

Parameters

_ConstantAddress
Address of the constant array to begin filling data. Possible values range from 0 to 95.
_Count
Number of constant vectors to load (4 DWORDs each) followed by 4*_Count DWORDs of data. See Remarks.

Remarks

The following code example shows how this macro might be used.

float diffuse[] = {1, 1, 1.0f/255.0f, 1};
        DWORD decl[] = 
        {
            D3DVSD_CONST(8, 1),
            *(DWORD*)&diffuse[0],
            *(DWORD*)&diffuse[1],
            *(DWORD*)&diffuse[2],
            *(DWORD*)&diffuse[3],
            D3DVSD_STREAM(0),
            D3DVSD_REG( 0, D3DVSDT_FLOAT3),
            D3DVSD_REG( 2, D3DVSDT_D3DCOLOR),
            D3DVSD_STREAM(1),
            D3DVSD_REG( 1, D3DVSDT_FLOAT1),
            D3DVSD_STREAM(2),
            D3DVSD_REG( 3, D3DVSDT_FLOAT2),
            D3DVSD_END()
        };

Requirements

  Header: Declared in D3d8types.h.

See Also

IDirect3DDevice8::CreateVertexShader