//decals
// ---- Created with 3Dmigoto v0.6.164 on Thu Dec 18 08:35:17 2025
cbuffer cb3 : register(b3)
{
  float4 cb3[21];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[4];
}

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

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




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


void main(
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD0,
  out float2 p1 : TEXCOORD4,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float3 o4 : TEXCOORD3)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;
  
float4 s = StereoParams.Load(0);
float4 texFilter = IniParams.Load(int2(14,0));
float4 testeo = IniParams.Load(int2(90,0));  

  r0.xyzw = cb3[18].xyzw * cb2[1].yyyy;
  r0.xyzw = cb3[17].xyzw * cb2[1].xxxx + r0.xyzw;
  r0.xyzw = cb3[19].xyzw * cb2[1].zzzz + r0.xyzw;
  r0.xyzw = cb3[20].xyzw * cb2[1].wwww + r0.xyzw;
  r0.xyzw = v0.yyyy * r0.xyzw;
  r1.xyzw = cb3[18].xyzw * cb2[0].yyyy;
  r1.xyzw = cb3[17].xyzw * cb2[0].xxxx + r1.xyzw;
  r1.xyzw = cb3[19].xyzw * cb2[0].zzzz + r1.xyzw;
  r1.xyzw = cb3[20].xyzw * cb2[0].wwww + r1.xyzw;
  r0.xyzw = r1.xyzw * v0.xxxx + r0.xyzw;
  r1.xyzw = cb3[18].xyzw * cb2[2].yyyy;
  r1.xyzw = cb3[17].xyzw * cb2[2].xxxx + r1.xyzw;
  r1.xyzw = cb3[19].xyzw * cb2[2].zzzz + r1.xyzw;
  r1.xyzw = cb3[20].xyzw * cb2[2].wwww + r1.xyzw;
  r0.xyzw = r1.xyzw * v0.zzzz + r0.xyzw;
  r1.xyzw = cb3[18].xyzw * cb2[3].yyyy;
  r1.xyzw = cb3[17].xyzw * cb2[3].xxxx + r1.xyzw;
  r1.xyzw = cb3[19].xyzw * cb2[3].zzzz + r1.xyzw;
  r1.xyzw = cb3[20].xyzw * cb2[3].wwww + r1.xyzw;
  r0.xyzw = r1.xyzw * v0.wwww + r0.xyzw;
  o0.xyzw = r0.xyzw;
  
  r0.x += s.x * (r0.w - s.y);
  float depth = r0.w;
  
  r1.xyzw = cb2[1].xyzw * v0.yyyy;
  r1.xyzw = cb2[0].xyzw * v0.xxxx + r1.xyzw;
  r1.xyzw = cb2[2].xyzw * v0.zzzz + r1.xyzw;
  r2.xy = cb2[3].zy * v0.ww + r1.zy;
  r1.xyzw = cb2[3].xyzw + r1.xyzw;
  r2.xy = -cb0[6].zx + r2.xy;
  r2.zw = cb0[6].wy + -cb0[6].zx;
  r2.xy = saturate(r2.xy / r2.zw);
  p1.xy = r2.xy * float2(-1,1) + float2(1,0);
  o1.xy = v1.xy;
  r0.y = cb1[5].x * r0.y;
  r2.xzw = float3(0.5,0.5,0.5) * r0.xwy;
  o2.zw = r0.zw;
  o2.xy = r2.xw + r2.zz;
  r0.xyz = cb3[10].xyz * r1.yyy;
  r0.xyz = cb3[9].xyz * r1.xxx + r0.xyz;
  r0.xyz = cb3[11].xyz * r1.zzz + r0.xyz;
  r0.xyz = cb3[12].xyz * r1.www + r0.xyz;
  
  float fov = rsqrt(cb3[17].x * cb3[17].x + cb3[18].x * cb3[18].x + cb3[19].x * cb3[19].x);
  //float fov1 = sqrt(cb3[17].x * cb3[17].x + cb3[18].x * cb3[18].x + cb3[19].x * cb3[19].x);
  //float fov2 = cb3[17].x * cb3[17].x + cb3[18].x * cb3[18].x + cb3[19].x * cb3[19].x;  

r0.x += s.x * (depth - s.y) * fov;
  
  o3.xyz = float3(-1,-1,1) * r0.xyz;
  o4.xyz = cb2[1].xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Thu Dec 18 08:35:17 2025
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 4     zw        1     NONE   float     zw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyz         4     NONE   float   xyz
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[7], immediateIndexed
dcl_constantbuffer CB1[6], immediateIndexed
dcl_constantbuffer CB2[4], immediateIndexed
dcl_constantbuffer CB3[21], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.zw
dcl_output o2.xyzw
dcl_output o3.xyz
dcl_output o4.xyz
dcl_temps 3
mul r0.xyzw, cb2[1].yyyy, cb3[18].xyzw
mad r0.xyzw, cb3[17].xyzw, cb2[1].xxxx, r0.xyzw
mad r0.xyzw, cb3[19].xyzw, cb2[1].zzzz, r0.xyzw
mad r0.xyzw, cb3[20].xyzw, cb2[1].wwww, r0.xyzw
mul r0.xyzw, r0.xyzw, v0.yyyy
mul r1.xyzw, cb2[0].yyyy, cb3[18].xyzw
mad r1.xyzw, cb3[17].xyzw, cb2[0].xxxx, r1.xyzw
mad r1.xyzw, cb3[19].xyzw, cb2[0].zzzz, r1.xyzw
mad r1.xyzw, cb3[20].xyzw, cb2[0].wwww, r1.xyzw
mad r0.xyzw, r1.xyzw, v0.xxxx, r0.xyzw
mul r1.xyzw, cb2[2].yyyy, cb3[18].xyzw
mad r1.xyzw, cb3[17].xyzw, cb2[2].xxxx, r1.xyzw
mad r1.xyzw, cb3[19].xyzw, cb2[2].zzzz, r1.xyzw
mad r1.xyzw, cb3[20].xyzw, cb2[2].wwww, r1.xyzw
mad r0.xyzw, r1.xyzw, v0.zzzz, r0.xyzw
mul r1.xyzw, cb2[3].yyyy, cb3[18].xyzw
mad r1.xyzw, cb3[17].xyzw, cb2[3].xxxx, r1.xyzw
mad r1.xyzw, cb3[19].xyzw, cb2[3].zzzz, r1.xyzw
mad r1.xyzw, cb3[20].xyzw, cb2[3].wwww, r1.xyzw
mad r0.xyzw, r1.xyzw, v0.wwww, r0.xyzw
mov o0.xyzw, r0.xyzw
mul r1.xyzw, v0.yyyy, cb2[1].xyzw
mad r1.xyzw, cb2[0].xyzw, v0.xxxx, r1.xyzw
mad r1.xyzw, cb2[2].xyzw, v0.zzzz, r1.xyzw
mad r2.xy, cb2[3].zyzz, v0.wwww, r1.zyzz
add r1.xyzw, r1.xyzw, cb2[3].xyzw
add r2.xy, r2.xyxx, -cb0[6].zxzz
add r2.zw, -cb0[6].zzzx, cb0[6].wwwy
div_sat r2.xy, r2.xyxx, r2.zwzz
mad o1.zw, r2.xxxy, l(0.000000, 0.000000, -1.000000, 1.000000), l(0.000000, 0.000000, 1.000000, 0.000000)
mov o1.xy, v1.xyxx
mul r0.y, r0.y, cb1[5].x
mul r2.xzw, r0.xxwy, l(0.500000, 0.000000, 0.500000, 0.500000)
mov o2.zw, r0.zzzw
add o2.xy, r2.zzzz, r2.xwxx
mul r0.xyz, r1.yyyy, cb3[10].xyzx
mad r0.xyz, cb3[9].xyzx, r1.xxxx, r0.xyzx
mad r0.xyz, cb3[11].xyzx, r1.zzzz, r0.xyzx
mad r0.xyz, cb3[12].xyzx, r1.wwww, r0.xyzx
mul o3.xyz, r0.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
mov o4.xyz, cb2[1].xyzx
ret
// Approximately 0 instruction slots used

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