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.
[ ] syntax | Effective index | Examples |
---|
R[ A + m0 + ... + mj ] | A + m0 + ... + mj | c[ a0.x + 3 + 7 ] |
R[ k ] ( = Rk ) | k | c[ 10 ] ( = c10 ) |
R[ A ] | A | c[ a0.y ] |
Rk[ n0 + ... + ni + A + m0 + ... + mj ] | A + k + n0 + ... + ni + m0 + ... + mj | c8[ 3 + 2 + a0.w + 5 + 6 + 1 ] |
R[ n0 + ... + ni + A + m0 + ... + mj ] | A + n0 + ... + ni + m0 + ... + mj | c[ 2 + 1 + aL + 3 + 4 + 5 ] |
Rk[ A ] | A + k | c12[ aL ], c0[ a0.z ] |
Rk[ A + m0 + ... + mj ] | A + k + m0 + ... + mj | v1[ aL + 4 + 8 ] |
R[ n0 + ... + ni + A ] | A + n0 + ... + ni | o[ 3 + 1 + aL ] |
Rk[ n0 + ... + ni + A ] | A + k + n0 + ... + ni | o1[ 2 + 1 + 3 + aL ] |
The registers are available in the following versions:
Register type | Shader versions |
---|
a0 | vs_1_1 and higher |
aL | vs_2_0 and higher, ps_3_0 |
cn | vs_1_1 and higher, ps_3_0 |
on | vs_3_0 |