您的位置:首页 > 其它

hlsl register

2017-01-06 16:02 316 查看

https://msdn.microsoft.com/en-us/library/dd607359(v=VS.85).aspx


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] );
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: