ategpu vertext shader ISA
new 32bit ISA for ATEGPU
1.four vector instruction
mac dst, src0, src1, src2
Trfm dst, A0.[vcro], src0
2. three vector instruction


3. swiz instruction
![]()
4. jump instruction

5. sfu instruction

6. Address Register Instruction

7. shift instruction

8 other instruction

![]()
9. example code
cregister 0 mv ; c[0-3] modelview matrix (column-wise)
cregister 4 mvinv ; c[4-7] modelview inverse transpose (column-wise)
cregister 8 mvp ; c[8-11] modelview projection matrix (column-wise)
cregister 16 lPos ; light position
cregister 17 c17 ; blinn halfway vector
cregister 18 c18 ; precomputed specular light * specular mat
cregister 19 c19 ; precomputed diffuse light * diffuse mat
cregister 20 c20 ; precomputed ambient light * ambient mat
cregister 21 c21 ; precomputed specularCol
iregister 0 iPos ; vetex.positon
iregister 1 iNormal ; vetex.normal
iregister 2 iColor ; vetex.color
vregister 0 xfNormal;
vregister 1 temp;
vregister 2 dots;
oregister 0 oPose ;
oregister 1 oColor;
#The instructions
#Transform the vertex to clip coordinates
dp4 oPos.x, mvp[0], iPos;
dp4 oPos.y, mvp[1], iPos;
dp4 oPos.z, mvp[2], iPos;
dp4 oPos.w, mvp[3], iPos;
#Transform the normal to eye coordinates
dp3 xfNormal.x, mvinv[0], iNormal;
dp3 xfNormal.y, mvinv[1], iNormal;
dp3 xfNormal.z, mvinv[2], iNormal;
#Compute diffuse and specular dot products
dp3 dots.x , xfNormal , lightDir
dp3 dots.y , xfNormal , halfDir;
mov dots.w , specExp.x
…
end
10. vasm compiler
A new compiler is builded the ategpu vertex shader asm code . I will upload the code.
标签:ISA, vertext shader相关日志
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
