//HUD VS (and other geometry).
// ---- Created with 3Dmigoto v1.3.6 on Sat Mar 17 09:29:19 2018

cbuffer VS_CONSTANT_BUFFER : register(b0)
{
  float4x4 mOTP : packoffset(c0);
}



// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float3 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : COLOR0,
  float2 v3 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float3 o1 : TEXCOORD1,
  out float4 o2 : COLOR0,
  out float4 o3 : TEXCOORD0,
  out float4 o4 : TEXCOORD2,
  out float4 o5 : TEXCOORD3)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams = IniParams.Load(0);
  float4 iniparams3 = IniParams.Load(int2(3,0));
  
  r0.xyzw = mOTP._m01_m11_m21_m31 * v0.yyyy;
  r0.xyzw = mOTP._m00_m10_m20_m30 * v0.xxxx + r0.xyzw;
  r0.xyzw = mOTP._m02_m12_m22_m32 * v0.zzzz + r0.xyzw;
  r0.xyzw = mOTP._m03_m13_m23_m33 + r0.xyzw;
  r0.z = r0.w + -r0.z;
  r0.xy = float2(1,-1) * r0.xy;
  r1.xyz = r0.xyz / r0.www;
  o0.xyzw = r0.xyzw;
  if (iniparams3.x==1)
  {
	o0.x+=stereo.x*iniparams.x;
	o0.x=o0.x*iniparams.y;
  }
  o5.w = r0.w;
  r0.xyz = r1.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  o5.xyz = r0.xyz * float3(1,-1,1) + float3(0,1,0);
  o1.xyz = v1.xyz;
  o2.xyzw = v2.xyzw;
  o3.xy = v3.xy;
  o4.xyz = v0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.6 on Sat Mar 17 09:29:19 2018
//
//
// Buffer Definitions:
//
// cbuffer VS_CONSTANT_BUFFER
// {
//
//   float4x4 mOTP;                     // Offset:    0 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// VS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// NORMAL                   0   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 1   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 2   xyz         4     NONE   float   xyz
// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[4], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o4.xyz
dcl_output o5.xyzw
dcl_temps 2
mul r0.xyzw, v0.yyyy, cb0[1].xyzw
mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[3].xyzw
add r0.z, -r0.z, r0.w
mul r0.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
div r1.xyz, r0.xyzx, r0.wwww
mov o0.xyzw, r0.xyzw
mov o5.w, r0.w
mad r0.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mad o5.xyz, r0.xyzx, l(1.000000, -1.000000, 1.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000)
mov o1.xyz, v1.xyzx
mov o2.xyzw, v2.xyzw
mov o3.xy, v3.xyxx
mov o4.xyz, v0.xyzx
ret
// Approximately 16 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
