//hud 4
// ---- Created with 3Dmigoto v1.3.11 on Sun Nov 11 12:26:55 2018

cbuffer _Globals : register(b0)
{
  row_major float4x4 mvp : packoffset(c0);
  row_major float4x4 texgen : packoffset(c4);
}



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

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

  o0.x = dot(v0.xyzw, mvp._m00_m01_m02_m03);
  o0.y = dot(v0.xyzw, mvp._m10_m11_m12_m13);
  o0.zw = v0.zw;
  o1.xyzw = v1.xyzw;
  r0.xy = saturate(v2.xy);
  o2.xy = r0.xy * texgen._m22_m23 + texgen._m20_m21;


//fix ui depth
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
float4 scaledepth = IniParams.Load(int2(2,0)).z;
    
    if(o0.x > -0.6 && o0.x < 0.55 && o0.y > -0.6 && o0.y < 0.75)
    {
      o0.x += stereo.x * scaledepth * params.z;
    }
else
{
  o0.x += stereo.x * params.z;
}



  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.11 on Sun Nov 11 12:26:55 2018
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   row_major float4x4 mvp;            // Offset:    0 Size:    64
//   row_major float4x4 texgen;         // Offset:   64 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
//
vs_4_0
dcl_constantbuffer cb0[7], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xy
dcl_temps 1
dp4 o0.x, v0.xyzw, cb0[0].xyzw
dp4 o0.y, v0.xyzw, cb0[1].xyzw
mov o0.zw, v0.zzzw
mov o1.xyzw, v1.xyzw
mov_sat r0.xy, v2.xyxx
mad o2.xy, r0.xyxx, cb0[6].zwzz, cb0[6].xyxx
ret
// Approximately 7 instruction slots used

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