//HUD - crosshairs

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,
  float4 v1 : COLOR0,
  out float4 o0 : COLOR0,
  out float4 o1 : SV_Position0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  o0.xyzw = v1.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);
  o1.x = -1 + r0.x;
  r0.x = -1 + r0.y;
  o1.y = -r0.x;
  o1.zw = v0.zw;
  
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);

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

  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//   using 3Dmigoto v1.2.29 on Wed Apr 06 19:52:45 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
// COLOR                    0   xyzw        1     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// SV_Position              0   xyzw        1      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[1], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_output o0.xyzw
dcl_output_siv o1.xyzw, position
dcl_temps 1
mov o0.xyzw, v1.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 o1.x, r0.x, l(-1.000000)
add r0.x, r0.y, l(-1.000000)
mov o1.y, -r0.x
mov o1.zw, v0.zzzw
ret 
// Approximately 9 instruction slots used

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