// ---- Created with 3Dmigoto v1.2.29 on Wed Apr 13 18:53:06 2016

cbuffer _Globals : register(b0)
{
  float4 screen_res : packoffset(c0);
}



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


void main( 
  float4 v0 : POSITIONT0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  out float2 o0 : TEXCOORD0,
  out float4 o1 : COLOR0,
  out float4 o2 : SV_Position0,
  out float depth : TEXCOORD1)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  o0.xy = v1.xy;
  o1.xyzw = v2.zyxw;
  r0.xy = float2(0.5,0.5) + v0.xy;
  r0.y = dot(r0.yy, screen_res.ww);
  r0.x = dot(r0.xx, screen_res.zz);
  o2.x = -1 + r0.x;
  r0.x = -1 + r0.y;
  o2.y = -r0.x;
  o2.zw = v0.zw;
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);

if(params.x==1)
{
	o2.x -= stereo.x * (o2.w - stereo.y);
}

depth = v0.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//   using 3Dmigoto v1.2.29 on Wed Apr 13 18:53:06 2016
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4 screen_res;                 // Offset:    0 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITIONT                0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// COLOR                    0   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy  
// COLOR                    0   xyzw        1     NONE   float   xyzw
// SV_Position              0   xyzw        2      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[1], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output o0.xy
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 1
mov o0.xy, v1.xyxx
mov o1.xyzw, v2.zyxw
add r0.xy, v0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
dp2 r0.y, r0.yyyy, cb0[0].wwww
dp2 r0.x, r0.xxxx, cb0[0].zzzz
add o2.x, r0.x, l(-1.000000)
add r0.x, r0.y, l(-1.000000)
mov o2.y, -r0.x
mov o2.zw, v0.zzzw
ret 
// Approximately 10 instruction slots used

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