Microsoft DirectX 8.0 (C++) |
Adds sources.
add vDest, vSrc0, vSrc1
The following code fragment shows the operations performed by the add instruction to write a result to the destination.
SetDestReg(); SetSrcReg(0); SetSrcReg(1); m_TmpReg.x = m_Source[0].x + m_Source[1].x; m_TmpReg.y = m_Source[0].y + m_Source[1].y; m_TmpReg.z = m_Source[0].z + m_Source[1].z; m_TmpReg.w = m_Source[0].w + m_Source[1].w; WriteResult();
The following examples illustrate how the add instruction might be used.
add r0, v0,c2 add r1.xyz, r0.xyz, v1.xyz