// HUD 5

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 float4 o3 : TEXCOORD2,
  out float4 o4 : TEXCOORD1,
  out float o5 : INSTANCE_COLOR0,
  out uint2 o6 : 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;
  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.xyzw = User.c[1].xyzw;
  o4.zw = User.c[0].zw + v2.xy;
  o4.xy = User.c[2].xz;
  o5.x = 0;
  o6.xy = float2(0,0);
  
  
  //Fix
  float4 stereo = StereoParams.Load(0);
  float4 iniParams = IniParams.Load(0);
  
  float4 tex_filter = IniParams.Load(int2(2,0));
  if (tex_filter.x == 2)
	  {
	   o0.x -= stereo.x * (o0.w - stereo.y);
	  }
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Wed May 15 19:24:01 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                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xyzw
// INSTANCE_COLOR           0   x           5     NONE   float   x
// INSTANCE_INDEXES         0   xy          6     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.xyzw
dcl_output o4.xyzw
dcl_output o5.x
dcl_output o6.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.xyzw, cb1[1].xyzw
add o4.zw, v2.xxxy, cb1[0].zzzw
mov o4.xy, cb1[2].xzxx
mov o5.x, l(0)
mov o6.xy, l(0,0,0,0)
ret
// Approximately 16 instruction slots used

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