Difference between revisions of "NV2A/Vertex Shader"

From xboxdevwiki
Jump to: navigation, search
(More register info, will be refactored soon)
Line 4: Line 4:
 
== Registers ==
 
== Registers ==
  
There are:
+
* 16 input registers v[0] to v[15] (from vertex, v[0] is fed from LAUNCH_DATA for VSPs)
 
+
* output registers: o[0] to o[?] (initialized to XYZ=0x00000000 W=0x3F800000)
* 12 temporary registers: R0 to R11
+
  * Following indices are aliased: Pos, oD0, oD1, oFog, oPts, oB0, oB1, oT0, oT1, oT2, oT3
* output registers: oPos, oD0, oD1, oFog, oPts, oB0, oB1, oT0, oT1, oT2, oT3, A0.x
+
* 1 Address register: A0.x
* Input data: ???
+
* 12 temporary registers: R0 to R11 (initialized to XYZW=0x00000000)
 
+
  * The POS register is mirrored as R12 so it can be used as source operand, so effectively you have 13 temporaries
R12 is a mirror of the output register oPos
 
  
 
== Instructions ==
 
== Instructions ==
  
 
???
 
???

Revision as of 19:26, 21 April 2017

The Xbox implements https://www.opengl.org/registry/specs/NV/vertex_program.txt and https://www.opengl.org/registry/specs/NV/vertex_program1_1.txt This article will mainly focus on actual encoding on hardware as the behaviour is mostly outlined in those GL extensions already.

Registers

  • 16 input registers v[0] to v[15] (from vertex, v[0] is fed from LAUNCH_DATA for VSPs)
  • output registers: o[0] to o[?] (initialized to XYZ=0x00000000 W=0x3F800000)
 * Following indices are aliased: Pos, oD0, oD1, oFog, oPts, oB0, oB1, oT0, oT1, oT2, oT3
  • 1 Address register: A0.x
  • 12 temporary registers: R0 to R11 (initialized to XYZW=0x00000000)
 * The POS register is mirrored as R12 so it can be used as source operand, so effectively you have 13 temporaries

Instructions

???