// hlsltool.py --install-to c:\py\1 --auto-fix-vertex-halo --only-autofixed --no-validate --ignore-other-errors a50f851f4b4eea77-vs_replace.txt
// ---- Created with 3Dmigoto v1.2.62 on Sun Jul 16 13:12:03 2017
cbuffer cb1 : register(b1)
{
  float4 cb1[4];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[6];
}




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


void main( 
  float4 v0 : POSITION0,
  float3 v1 : NORMAL0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float3 o2 : TEXCOORD1)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

float4 stereo = StereoParams.Load(0);
float separation = stereo.x, convergence = stereo.y, eye = stereo.z;

  r0.xyzw = cb1[1].xyzw * v0.yyyy;
  r0.xyzw = cb1[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb1[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb1[3].xyzw + r0.xyzw;
  o0.xyzw = r0.xyzw;

// Automatic vertex shader halo fix inserted with DarkStarSword's hlsltool.py:
// hlsltool.py --install-to c:\py\1 --auto-fix-vertex-halo --only-autofixed --no-validate --ignore-other-errors a50f851f4b4eea77-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  r0.y = cb0[5].x * r0.y;
  r0.xz = float2(0.5,0.5) * r0.xw;
  r0.w = 0.5 * r0.y;
  o1.xy = r0.xw + r0.zz;
  o2.xyz = v1.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// NORMAL                   0   xyz         1     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyz
dcl_temps 1
mul r0.xyzw, v0.yyyy, cb1[1].xyzw
mad r0.xyzw, cb1[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb1[2].xyzw, v0.zzzz, r0.xyzw
add r0.xyzw, r0.xyzw, cb1[3].xyzw
mov o0.xyzw, r0.xyzw
mul r0.y, r0.y, cb0[5].x
mul r0.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
mul r0.w, r0.y, l(0.500000)
add o1.xy, r0.zzzz, r0.xwxx
mov o2.xyz, v1.xyzx
ret 
// Approximately 0 instruction slots used

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


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Black The Fall\ShaderCache\a50f851f4b4eea77-vs_replace.txt(25,14-15): warning X3578: Output value 'o1' is not completely initialized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
