//nofix
// ---- Created with 3Dmigoto v1.3.11 on Sun Jan 06 12:33:03 2019

cbuffer cb_g_Pass : register(b2)
{

  struct
  {
    float4 m_EyePosition;
    float4 m_EyeDirection;
    float4x4 m_ViewToWorld;
    float4x4 m_WorldToView;
    float4x4 m_ProjMatrix;
    float4x4 m_ViewProj;
    float4x4 m_ViewNoTranslationProj;
    float4 m_ViewTranslation;

    struct
    {
      float4x4 clipXYZToViewPos;
      float4x4 clipXYZToWorldPos;
      float4 clipZToViewZ;
    } reverseProjParams;

    float4 m_VPosToUV;
    float4 m_ViewportScaleOffset;
    float4 m_ClipPlane;
    float4 m_GlobalLightingScale;
    float4 m_ViewSpaceLightingBackWS;
    float4 m_ThinGeomAAPixelScale;
  } g_Pass : packoffset(c0);

}

Texture2DMS<float,4> t_DepthBufferSampler : register(t0);


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


void main(
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  uint v2 : SV_SampleIndex0,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = (uint2)v0.xy;
  r0.zw = float2(0,0);
  r0.x = t_DepthBufferSampler.Load(r0.xy, v2.x).x;
  r0.yz = r0.xx * g_Pass.reverseProjParams.clipZToViewZ.wz + g_Pass.reverseProjParams.clipZToViewZ.yx;
  o1.xyzw = r0.xxxx;
  o0.xyzw = r0.yyyy / r0.zzzz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.11 on Sun Jan 06 12:33:03 2019
//
//
// Buffer Definitions:
//
// cbuffer cb_g_Pass
// {
//
//   struct PassConsts
//   {
//
//       float4 m_EyePosition;          // Offset:    0
//       float4 m_EyeDirection;         // Offset:   16
//       float4x4 m_ViewToWorld;        // Offset:   32
//       float4x4 m_WorldToView;        // Offset:   96
//       float4x4 m_ProjMatrix;         // Offset:  160
//       float4x4 m_ViewProj;           // Offset:  224
//       float4x4 m_ViewNoTranslationProj;// Offset:  288
//       float4 m_ViewTranslation;      // Offset:  352
//
//       struct ReverseProjParams
//       {
//
//           float4x4 clipXYZToViewPos; // Offset:  368
//           float4x4 clipXYZToWorldPos;// Offset:  432
//           float4 clipZToViewZ;       // Offset:  496
//
//       } reverseProjParams;           // Offset:  368
//       float4 m_VPosToUV;             // Offset:  512
//       float4 m_ViewportScaleOffset;  // Offset:  528
//       float4 m_ClipPlane;            // Offset:  544
//       float4 m_GlobalLightingScale;  // Offset:  560
//       float4 m_ViewSpaceLightingBackWS;// Offset:  576
//       float4 m_ThinGeomAAPixelScale; // Offset:  592
//
//   } g_Pass;                          // Offset:    0 Size:   608
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// t_DepthBufferSampler              texture   float       2dMS4    0        1
// cb_g_Pass                         cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xy          1     NONE   float
// SV_SampleIndex           0   x           2   SAMPLE    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
// Pixel Shader runs at sample frequency
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[32], immediateIndexed
dcl_resource_texture2dms(4) (float,float,float,float) t0
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps_sgv v2.x, sampleIndex
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 1
ftou r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ldms_indexable(texture2dms)(float,float,float,float) r0.x, r0.xyzw, t0.xyzw, v2.x
mad r0.yz, r0.xxxx, cb2[31].wwzw, cb2[31].yyxy
mov o1.xyzw, r0.xxxx
div o0.xyzw, r0.yyyy, r0.zzzz
ret
// Approximately 7 instruction slots used

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