//letterbox bars
// ---- Created with 3Dmigoto v1.3.2 on Sat Feb 20 20:39:33 2021
cbuffer cb2 : register(b2)
{
  float4 cb2[8];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[7];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[6];
}




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


void main(
  float4 v0 : POSITION0,
  float3 v1 : NORMAL0,
  out float4 o0 : TEXCOORD4,
  out float4 o1 : TEXCOORD5,
  out float3 o2 : TEXCOORD6,
  out float4 o3 : SV_Position0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = 1 / cb0[5].w;
  r1.w = 1;
  r0.yzw = cb2[7].xyz * v0.www;
  r0.yzw = v0.xyz * cb2[5].xyz + r0.yzw;
  r0.yzw = cb2[6].xyz + r0.yzw;
  r0.yzw = cb1[6].xyz * r0.yzw;
  r2.x = dot(r0.yzw, cb1[0].xyz);
  r1.x = cb1[0].w + r2.x;
  r2.x = dot(r0.yzw, cb1[1].xyz);
  r0.y = dot(r0.yzw, cb1[2].xyz);
  r1.z = cb1[2].w + r0.y;
  r1.y = cb1[1].w + r2.x;
  r0.y = dot(r1.xyzw, cb0[4].xyzw);
  r0.x = -r0.y * r0.x;
  o0.w = min(1, r0.x);
  o0.xyz = float3(0,0,0);
  r0.x = dot(v1.xyz, cb1[0].xyz);
  r0.y = dot(v1.xyz, cb1[1].xyz);
  r0.z = dot(v1.xyz, cb1[2].xyz);
  r0.w = dot(r0.xyz, r0.xyz);
  r1.w = rsqrt(r0.w);
  r0.w = cmp(0 < r0.w);
  r0.xyz = r1.www * r0.xyz;
  o1.xyz = r0.www ? r0.xyz : float3(0.57735002,0.57735002,0.57735002);
  o1.w = 0;
  o2.xyz = r1.xyz;
  r0.xyzw = cb0[1].xyzw * r1.yyyy;
  r0.xyzw = r1.xxxx * cb0[0].xyzw + r0.xyzw;
  r0.xyzw = r1.zzzz * cb0[2].xyzw + r0.xyzw;
  o3.xyzw = cb0[3].xyzw + r0.xyzw;

float depth = StereoParams.Load(0).x; 
float convergence = StereoParams.Load(0).y;
if(o3.w >= 40.995 && o3.w < 41.01){o3.x -= depth * (o3.w - convergence);}

  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.2 on Sat Feb 20 20:39:33 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 4   xyzw        0     NONE   float   xyzw
// TEXCOORD                 5   xyzw        1     NONE   float   xyzw
// TEXCOORD                 6   xyz         2     NONE   float   xyz
// SV_Position              0   xyzw        3      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[7], immediateIndexed
dcl_constantbuffer cb2[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output_siv o3.xyzw, position
dcl_temps 3
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), cb0[5].w
mov r1.w, l(1.000000)
mul r0.yzw, v0.wwww, cb2[7].xxyz
mad r0.yzw, v0.xxyz, cb2[5].xxyz, r0.yyzw
add r0.yzw, r0.yyzw, cb2[6].xxyz
mul r0.yzw, r0.yyzw, cb1[6].xxyz
dp3 r2.x, r0.yzwy, cb1[0].xyzx
add r1.x, r2.x, cb1[0].w
dp3 r2.x, r0.yzwy, cb1[1].xyzx
dp3 r0.y, r0.yzwy, cb1[2].xyzx
add r1.z, r0.y, cb1[2].w
add r1.y, r2.x, cb1[1].w
dp4 r0.y, r1.xyzw, cb0[4].xyzw
mul r0.x, r0.x, -r0.y
min o0.w, r0.x, l(1.000000)
mov o0.xyz, l(0,0,0,0)
dp3 r0.x, v1.xyzx, cb1[0].xyzx
dp3 r0.y, v1.xyzx, cb1[1].xyzx
dp3 r0.z, v1.xyzx, cb1[2].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r1.w, r0.w
lt r0.w, l(0.000000), r0.w
mul r0.xyz, r0.xyzx, r1.wwww
movc o1.xyz, r0.wwww, r0.xyzx, l(0.577350,0.577350,0.577350,0)
mov o1.w, l(0)
mov o2.xyz, r1.xyzx
mul r0.xyzw, r1.yyyy, cb0[1].xyzw
mad r0.xyzw, r1.xxxx, cb0[0].xyzw, r0.xyzw
mad r0.xyzw, r1.zzzz, cb0[2].xyzw, r0.xyzw
add o3.xyzw, r0.xyzw, cb0[3].xyzw
ret
// Approximately 0 instruction slots used

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