Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

register

Optional keyword for assigning a shader variable to a particular register, which uses the following syntax:

: register ( [shader_profile]Type#[subcomponent] )

 

Parameters

register

Required keyword.

[shader_profile]

Optional shader profile, which can be a shader target or simply ps or vs.

Type#[subcomponent]

Register type, number, and subcomponent declaration.

  • Type is one of the following:

    TypeRegister Description
    bConstant buffer
    tTexture and texture buffer
    cBuffer offset
    sSampler
    uUnordered Access View

     

  • # is the register number, which is an integer number.
  • The subcomponent is an optional integer number.

Remarks

You may add one or more register assignments to the same variable declaration, separated by spaces.

For Direct3D 10 variables in global scope, the register keyword acts the same as the packoffset (DirectX HLSL) keyword.

Examples

Here are some examples:



sampler myVar : register( ps_5_0, s ); 




sampler myVar : register( vs, s[8] );




sampler myVar : register( ps, s[2] ) 
              : register( ps_5_0, s[0] ) 
              : register( vs, s[8] );


See also

Variables (DirectX HLSL)

 

 

Community Additions

Show:
© 2014 Microsoft