// HUD 1

cbuffer CBufferGlobalConstant_Z : register(b0)
{

  struct
  {
    float4 c[90];
  } Global : packoffset(c0);

}

cbuffer CBufferUserConstant_Z : register(b1)
{

  struct
  {
    float4 c[58];
  } User : packoffset(c0);

}



// 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 float4 o2 : TEXCOORD0,
  out float2 o3 : TEXCOORD1,
  out float p3 : INSTANCE_COLOR0,
  out uint2 o4 : INSTANCE_INDEXES0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = -Global.c[16].zw + v0.xy;
  r0.xy = r0.xy / Global.c[16].xy;
  r0.z = v0.z * Global.c[52].z + Global.c[52].w;
  o0.xy = r0.xy * r0.zz;
  o0.w = r0.z;
  o0.z = v0.z * Global.c[51].z + Global.c[51].w;
  
  //Fix
  float4 stereo = StereoParams.Load(0);
  float4 iniParams = IniParams.Load(0);
  
  o0.x -= stereo.x * (o0.w - stereo.y);


        
  float4 tex_filter = IniParams.Load(int2(2,0));
//  if (tex_filter.x == 3)
	  //{
	   //o0.x += stereo.x * iniParams.x;
	  //}


  //if (tex_filter.x == 4)
//    {
     //o0.x += stereo.x * iniParams.x;
    //}
//
//else
//{
  
  o0.x += stereo.x * iniParams.x;
//}

  
  o1.xyz = User.c[3].xyz * User.c[3].www + v1.xyz;
  o1.w = v1.w;
  o2.zw = User.c[0].xy * v2.xy;
  o2.xy = v2.xy;
  o3.xy = User.c[2].xz;
  p3.x = 0;
  o4.xy = float2(0,0);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Tue May 14 19:03:37 2019
//
//
// Buffer Definitions:
//
// cbuffer CBufferGlobalConstant_Z
// {
//
//   struct StructGlobalConstant_Z
//   {
//
//       float4 c[90];                  // Offset:    0
//
//   } Global;                          // Offset:    0 Size:  1440
//
// }
//
// cbuffer CBufferUserConstant_Z
// {
//
//   struct StructUserConstant_Z
//   {
//
//       float4 c[58];                  // Offset:    0
//
//   } User;                            // Offset:    0 Size:   928
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// CBufferGlobalConstant_Z           cbuffer      NA          NA    0        1
// CBufferUserConstant_Z             cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz
// 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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 1   xy          3     NONE   float   xy
// INSTANCE_COLOR           0     z         3     NONE   float     z
// INSTANCE_INDEXES         0   xy          4     NONE    uint   xy
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[53], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o3.z
dcl_output o4.xy
dcl_temps 1
add r0.xy, v0.xyxx, -cb0[16].zwzz
div r0.xy, r0.xyxx, cb0[16].xyxx
mad r0.z, v0.z, cb0[52].z, cb0[52].w
mul o0.xy, r0.zzzz, r0.xyxx
mov o0.w, r0.z
mad o0.z, v0.z, cb0[51].z, cb0[51].w
mad o1.xyz, cb1[3].xyzx, cb1[3].wwww, v1.xyzx
mov o1.w, v1.w
mul o2.zw, v2.xxxy, cb1[0].xxxy
mov o2.xy, v2.xyxx
mov o3.xy, cb1[2].xzxx
mov o3.z, l(0)
mov o4.xy, l(0,0,0,0)
ret
// Approximately 14 instruction slots used

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