//HUD VS 5. Part of main menu.
// ---- Created with geo-11 v0.6.193 on Sun May 26 12:46:59 2024

cbuffer PER_BATCH : register(b0)
{
  row_major float4x4 cCompositeMat : packoffset(c0);
}



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


void main(
  int4 v0 : POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : COLOR1,
  out float4 o0 : SV_Position0,
  out float4 o1 : COLOR0,
  out float4 o2 : COLOR1)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  float4 iniparams3 = IniParams.Load(int2(3,0));
  float4 iniparams10 = IniParams.Load(int2(10,0));
  
  r0.xy = (int2)v0.xy;
  r0.z = 1;
  o0.x = dot(cCompositeMat._m00_m01_m03, r0.xyz);
  o0.y = dot(cCompositeMat._m10_m11_m13, r0.xyz);
  o0.z = dot(cCompositeMat._m20_m21_m23, r0.xyz);
  o0.w = dot(cCompositeMat._m30_m31_m33, r0.xyz);
  o1.xyzw = v1.xyzw;
  o2.xyzw = v2.xyzw;
  
  if (o0.w!=1 && iniparams10.y==1) {
    //o0.x-=stereo.x*(o0.w-stereo.y);
	//o0.x+=stereo.x*o0.w*iniparams3.x;
	o0.x-=stereo.x*stereo.y*iniparams3.y;
  } else if (o0.w==1 && iniparams10.x==1 && iniparams10.y==0) {
    o0.x+=stereo.x*(o0.w-stereo.y*iniparams3.y/37234.0425532);
  } else if (o0.w!=1 && iniparams10.x==1 && iniparams10.y==0) {
    o0.x-=stereo.x*stereo.y*iniparams3.y;
  }
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v0.6.193 on Sun May 26 12:46:59 2024
//
//
// Buffer Definitions:
//
// cbuffer PER_BATCH
// {
//
//   row_major float4x4 cCompositeMat;  // Offset:    0 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PER_BATCH                         cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE     int   xy
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[4], immediateIndexed
dcl_input v0.xy
dcl_input v1.xyzw
dcl_input v2.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_temps 1
itof r0.xy, v0.xyxx
mov r0.z, l(1.000000)
dp3 o0.x, cb0[0].xywx, r0.xyzx
dp3 o0.y, cb0[1].xywx, r0.xyzx
dp3 o0.z, cb0[2].xywx, r0.xyzx
dp3 o0.w, cb0[3].xywx, r0.xyzx
mov o1.xyzw, v1.xyzw
mov o2.xyzw, v2.xyzw
ret
// Approximately 9 instruction slots used

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