Relative Addressing

The [ ] syntax can be used only in register types that can be relatively addressed in certain shader models. The supported forms of [ ] syntax are listed as follows:

Where:

  • "R" denotes any register type that can be relatively addressed.
  • "A" denotes any register that can be used as an index to relatively address other registers.
  • n0 - ni, m0 - mj, and k are integers >= 0.
[ ] syntaxEffective indexExamples
R[ A + m0 + ... + mj ]A + m0 + ... + mjc[ a0.x + 3 + 7 ]
R[ k ] ( = Rk )kc[ 10 ] ( = c10 )
R[ A ]Ac[ a0.y ]
Rk[ n0 + ... + ni + A + m0 + ... + mj ]A + k + n0 + ... + ni + m0 + ... + mjc8[ 3 + 2 + a0.w + 5 + 6 + 1 ]
R[ n0 + ... + ni + A + m0 + ... + mj ]A + n0 + ... + ni + m0 + ... + mjc[ 2 + 1 + aL + 3 + 4 + 5 ]
Rk[ A ]A + kc12[ aL ], c0[ a0.z ]
Rk[ A + m0 + ... + mj ]A + k + m0 + ... + mjv1[ aL + 4 + 8 ]
R[ n0 + ... + ni + A ]A + n0 + ... + nio[ 3 + 1 + aL ]
Rk[ n0 + ... + ni + A ]A + k + n0 + ... + nio1[ 2 + 1 + 3 + aL ]

 

The registers are available in the following versions:

Register typeVertex Shader Versions
a0All
aLvs_2_0 and higher
cnvs_1_1 and higher
onvs_3_0

 

Related topics

Vertex Shader Registers

 

 

Show: