//Shadows PS from cache.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Fri Jan 14 20:07:40 2022
//
//
// Note: shader requires additional functionality:
//       64 UAV slots
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__modelData
// {
//
//   struct ModelData
//   {
//
//       uint lightGroupID;             // Index:    0
//       uint modelFlags;               // Index:    0.y
//       float lodFade;                 // Index:    0.z
//       float displacementBlend;       // Index:    0.w
//       int turbulenceDataIdx;         // Index:    1
//       int instanceOffset;            // Index:    1.y
//       int characterFxIdx;            // Index:    1.z
//       uint debugRenderChannel;       // Index:    1.w
//       uint decayWriteOffset;         // Index:    2
//       uint decayWriteMaxCount;       // Index:    2.y
//       uint decayAtomicCounterIndex;  // Index:    2.z
//       float modelAlpha;              // Index:    2.w
//       float emissiveScale;           // Index:    3
//       float desaturationScale;       // Index:    3.y
//       float decayCoverageEstimation; // Index:    3.z
//       float3 quantScale;             // Index:    4
//       float3 quantBias;              // Index:    5
//
//   } resourceTables__modelData;       // Index:    0-5.z            Components:    23
//
// }
//
// cbuffer ConstBuf__viewData
// {
//
//   struct ViewData
//   {
//
//       float4x4 view;                 // Index:    0
//       float4x4 invView;              // Index:    4
//       float4x4 proj;                 // Index:    8
//       float4x4 invViewProjNoZReproj; // Index:   12
//       float4x4 viewProj;             // Index:   16
//       float4x4 invViewProj;          // Index:   20
//       float4x4 previousViewProj;     // Index:   24
//       float4 prevLodEyePos;          // Index:   28
//       float4 lodEyePos;              // Index:   29
//       float4 viewDirDepthBias;       // Index:   30
//       float3 eyePos;                 // Index:   31
//       float2 viewportSize;           // Index:   32
//       float2 invViewportSize;        // Index:   32.z
//       float4 mirrorPlaneWS;          // Index:   33
//       float2 mirrorViewportSize;     // Index:   34
//       float2 opaqueRefractionViewportSize;// Index:   34.z
//       float windTime;                // Index:   35
//       float deltaTime;               // Index:   35.y
//       float depthReprojectScale;     // Index:   35.z
//       float depthReprojectBias;      // Index:   35.w
//       uint shadowViewType;           // Index:   36
//       float normalDepthBias;         // Index:   36.y
//       float noNormalAA;              // Index:   36.z
//       float noNormalFromAlpha;       // Index:   36.w
//       float noOpaqueTransparency;    // Index:   37
//       float translucentAmount;       // Index:   37.y
//       uint framePhase;               // Index:   37.z
//       float cameraAmbientExposure;   // Index:   37.w
//       float fxExposure;              // Index:   38
//       float fxAmbientExposure;       // Index:   38.y
//       uint checkerboardPhase;        // Index:   38.z
//       float sparkleIntensityScale;   // Index:   38.w
//
//   } resourceTables__viewData;        // Index:    0-38             Components:   156
                                        // Texture:   t8
//
// }
//
// cbuffer ConstBuf__materialData
// {
//
//   struct MaterialData
//   {
//
//       float3 material_particlespawn_matU;// Index:    0
//       float3 material_particlespawn_matV;// Index:    1
//       float3 LayerX_alpha_matU;      // Index:    2
//       float3 LayerX_alpha_matV;      // Index:    3
//
//   } resourceTables__materialData;    // Index:    0-3.z            Components:    15
                                        // Textures:  t11-t13
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__viewData__smpLinear    sampler      NA          NA    1        1
// resourceTables__viewData__smpLowAniso    sampler      NA          NA    2        1
// resourceTables__viewData__smpPointClamp    sampler      NA          NA    4        1
// resourceTables__passData.depthTexture    texture  float4          2d    0        1
// resourceTables__passData.normalTexture    texture  float4          2d    1        1
// resourceTables__viewData.blueNoiseTexture    texture   float     2darray    8        1
// resourceTables__materialData.material_particlespawn    texture  float4          2d   11        1
// resourceTables__materialData.LayerX_opacity    texture  float4          2d   12        1
// resourceTables__materialData.LayerX_alpha    texture  float4          2d   13        1
// resourceTables__passData.decaySpawnBuffer        UAV    uint         buf    8        1
// resourceTables__passData.decayAtomicCountersBuffer        UAV    uint         buf    9        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__viewData                cbuffer      NA          NA    3        1
// ConstBuf__materialData            cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// VERT_ID                  0   x           1     NONE    uint   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// NORMAL                   0   xyz         3     NONE   float   xyz
// TANGENT                  0   xyz         4     NONE   float   xyz
// BINORMAL                 0   xyz         5     NONE   float   xyz
// TEXCOORD                 5   xyzw        6     NONE   float   x
// TEXCOORD                 8   xyz         7     NONE   float
//
//
// 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
// SV_Target                2   xyzw        2   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb3[38], immediateIndexed
dcl_constantbuffer cb4[4], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2darray (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_uav_typed_buffer (uint,uint,uint,uint) u8
dcl_uav_typed_buffer (uint,uint,uint,uint) u9
dcl_input_ps_siv linear noperspective v0.xyzw, position
dcl_input_ps constant v1.x
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.x
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_temps 50
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
and r0.x, v1.x, l(0x00ffffff)
ne r0.y, l(1.000000), cb1[2].w
if_nz r0.y
  ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[37].x
  if_z r0.y
    ftoi r0.yz, v0.xxyx
    iadd r0.w, r0.x, l(1)
    and r0.w, r0.w, l(7)
    imad r0.yz, r0.wwww, l(0, 7, 7, 0), r0.yyzy
    and r1.xy, r0.yzyy, l(63, 63, 0, 0)
    and r1.z, l(7), cb3[37].z
    mov r1.w, l(0)
    ld_indexable(texture2darray)(float,float,float,float) r0.y, r1.xyzw, t8.yxzw
  else
    mov r0.y, l(0)
  endif
  ge r0.y, r0.y, cb1[2].w
  discard_nz r0.y
endif
mul r0.yz, v0.xxyx, cb3[32].zzwz
mad r1.xy, r0.yzyy, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mad r0.w, v0.z, cb3[35].z, cb3[35].w
rcp r0.w, r0.w
mov r2.z, -r0.w
mul r2.xy, r1.xyxx, r2.zzzz
mov r2.w, l(1.000000)

add r40.w, r2.z, -r40.y
mad r2.x, -r40.x, r40.w, r2.x

dp4 r1.z, r2.xyzw, cb3[12].xyzw
dp4 r1.x, r2.xyzw, cb3[13].xyzw
dp4 r1.y, r2.xyzw, cb3[14].xyzw
mad r2.xy, r0.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r0.yzyy, t1.xyzw, s4
mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
mad r0.yz, -cb3[32].zzwz, l(0.000000, 0.500000, 0.500000, 0.000000), r0.yyzy
gather4_indexable(texture2d)(float,float,float,float) r4.z, r0.yzyy, t0.xzyw, s4.x
mov r2.z, -r2.y
mul r4.xy, r2.xzxx, r4.zzzz
mov r4.w, l(1.000000)

add r40.w, r4.z, -r40.y
mad r4.x, -r40.x, r40.w, r4.x

dp4 r2.x, r4.xyzw, cb3[12].xyzw
dp4 r2.y, r4.xyzw, cb3[13].xyzw
dp4 r2.z, r4.xyzw, cb3[14].xyzw
add r0.yzw, r1.zzxy, -r2.xxyz
dp3 r0.y, v3.xyzx, r0.yzwy
add r0.z, -r0.y, l(1.600000)
dp3 r0.w, r3.xyzx, v3.xyzx
add r0.w, r0.w, l(-0.928363919)
mul_sat r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.833333313, 13.959446)
mul r0.w, r0.w, r0.w
mul r3.z, r0.w, r0.z
lt r0.z, l(0.000000), r3.z
deriv_rty_coarse r3.xy, v2.xyxx
and r3.xyz, r3.xyzx, r0.zzzz
ge r0.w, l(0.000000), r3.z
discard_nz r0.w
mad r4.xyz, r0.yyyy, v3.xyzx, r2.xyzx
add r4.xyz, -r1.zxyz, r4.xyzx
dp3 r0.y, -r4.xyzx, v4.xyzx
dp3 r4.y, -r4.xyzx, v5.xyzx
mov r4.x, -r0.y
deriv_rtx_fine r0.yw, v2.xxxy
deriv_rty_fine r4.zw, v2.yyyx
deriv_rtx_fine r5.xyz, r1.yzxy
deriv_rty_fine r1.xyz, r1.xyzx
mul r0.w, r0.w, r4.w
mad r0.y, r0.y, r4.z, -r0.w
mul r6.xyz, r1.xyzx, r5.xyzx
mad r1.xyz, r5.zxyz, r1.yzxy, -r6.xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
sqrt r0.w, r0.w
lt r1.x, l(0.000000), r0.w
div r0.y, |r0.y|, r0.w
sqrt r0.y, r0.y
and r0.y, r0.y, r1.x
mad r1.xy, r4.xyxx, r0.yyyy, v2.xyxx
deriv_rtx_coarse r0.yw, v2.xxxy
and r0.yz, r0.yywy, r0.zzzz
mov r1.z, l(1.000000)
dp3 r4.x, cb4[2].xyzx, r1.xyzx
dp3 r4.y, cb4[3].xyzx, r1.xyzx
sample_d_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t12.yzwx, s1, r0.yzyy, r3.xyxx
sample_d_indexable(texture2d)(float,float,float,float) r0.y, r4.xyxx, t13.yxzw, s2, r0.yzyy, r3.xyxx
mul r0.y, r0.y, v6.x
mad r0.y, r0.y, r0.w, l(-0.149780)
mul_sat r0.z, r0.y, l(2.50481558)
mul r0.z, r3.z, r0.z
ge r0.w, l(0.000000), r0.z
discard_nz r0.w
ult r0.w, cb1[2].z, l(64)
if_nz r0.w
  dp3 r3.x, cb4[0].xyzx, r1.xyzx
  dp3 r3.y, cb4[1].xyzx, r1.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t11.yzwx, s1, l(0.000000)
  ne r1.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[37].x
  if_z r1.x
    ftoi r1.xy, v0.xyxx
    iadd r0.x, r0.x, cb3[37].z
    imul null, r0.x, r0.x, l(4099)
    and r0.x, r0.x, l(63)
    iadd r1.xy, r0.xxxx, r1.xyxx
    utof r1.xy, r1.xyxx
    mul r1.xy, r1.xyxx, l(0.0671105608, 0.00583714992, 0.000000, 0.000000)
    add r0.x, r1.y, r1.x
    frc r0.x, r0.x
    mul r0.x, r0.x, l(52.982918)
    frc r0.x, r0.x
  else
    mov r0.x, l(0)
  endif
  lt r1.x, r0.w, l(0.313726)
  if_nz r1.x
    discard_nz l(-1)
  else
    ge r0.x, cb1[3].z, r0.x
    ftou r1.xy, v0.xyxx
    mov r1.zw, l(0,0,0,0)
    ld_indexable(texture2d)(float,float,float,float) r1.x, r1.xyzw, t0.xyzw
    add r1.x, r1.x, -v0.w
    ge r1.x, l(0.000005), |r1.x|
    and r0.x, r0.x, r1.x
    lt r1.x, l(0.313726), r0.w
    and r0.x, r0.x, r1.x
    lt r1.x, r0.w, l(1.313726)
    and r0.x, r0.x, r1.x
    if_nz r0.x
      imm_atomic_iadd r1.x, u9, cb1[2].z, l(1)
      ult r0.x, r1.x, cb1[2].y
      if_nz r0.x
        ftou r1.yz, v0.xxyx
        add_sat r0.x, r0.w, l(-0.313726)
        add r0.x, -r0.x, l(1.000000)
        mul r0.x, r0.x, l(255.000000)
        ftou r0.x, r0.x
        iadd r0.w, r1.x, cb1[2].x
        ishl r1.x, r0.w, l(1)
        bfi r1.y, l(16), l(16), r1.y, r1.z
        store_uav_typed u8.xyzw, r1.xxxx, r0.xxxx
        bfi r0.x, l(31), l(1), r0.w, l(1)
        store_uav_typed u8.xyzw, r0.xxxx, r1.yyyy
      endif
    endif
  endif
endif
dp3 r0.x, v3.xyzx, v3.xyzx
rsq r0.x, r0.x
mul r1.xyz, r0.xxxx, v3.xyzx
mul_sat r0.x, r0.y, l(6.217823)
mul r0.x, r0.x, l(10.000000)
deriv_rtx_fine r0.y, r0.x
deriv_rty_fine r0.x, r0.x
ne r3.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[36].wzww
dp3 r0.w, r2.xyzx, v4.xyzx
dp3 r1.w, r2.xyzx, v5.xyzx
deriv_rtx_fine r2.x, r0.w
deriv_rtx_fine r2.y, r1.w
deriv_rty_fine r4.x, r0.w
deriv_rty_fine r4.y, r1.w
dp2 r0.w, r2.xyxx, r2.xyxx
sqrt r0.w, r0.w
dp2 r1.w, r4.xyxx, r4.xyxx
sqrt r1.w, r1.w
lt r2.z, l(0.001000), r0.w
rcp r0.w, r0.w
mul r2.xy, r0.wwww, r2.xyxx
and r2.xy, r2.xyxx, r2.zzzz
lt r0.w, l(0.001000), r1.w
rcp r1.w, r1.w
mul r2.zw, r1.wwww, r4.xxxy
and r2.zw, r0.wwww, r2.zzzw
mul r0.xw, r0.xxxx, r2.zzzw
mad r2.xy, r2.xyxx, r0.yyyy, r0.xwxx
mov r2.z, l(1.000000)
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r0.xyw, r0.xxxx, r2.xyxz
movc r0.xyw, r3.xxxx, l(0,0,0,1.000000), r0.xyxw
dp3 r1.w, v4.xyzx, v4.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, v4.xyzx
dp3 r1.w, v5.xyzx, v5.xyzx
rsq r1.w, r1.w
mul r3.xzw, r1.wwww, v5.xxyz
dp3 r1.w, r0.xywx, r0.xywx
rsq r1.w, r1.w
mul r0.xyw, r0.xyxw, r1.wwww
mul r3.xzw, r3.xxzw, r0.yyyy
mad r2.xyz, r0.xxxx, r2.xyzx, r3.xzwx
mad r0.xyw, r0.wwww, r1.xyxz, r2.xyxz
dp3 r1.w, r0.xywx, r0.xywx
rsq r1.w, r1.w
mul r0.xyw, r0.xyxw, r1.wwww
deriv_rtx_fine r2.xyz, r1.xyzx
deriv_rty_fine r1.xyz, r1.xyzx
dp3 r1.w, r2.xyzx, r2.xyzx
dp3 r1.x, r1.xyzx, r1.xyzx
add r1.x, r1.x, r1.w
min r1.x, r1.x, l(0.300000)
add r1.x, r1.x, l(0.814506173)
sqrt r1.x, r1.x
min r1.x, r1.x, l(1.000000)
sqrt r1.x, r1.x
add r1.x, -r1.x, l(1.000000)
movc o2.z, r3.y, l(0.0500000119), r1.x
mad o1.xyz, r0.xywx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mov o0.xyz, l(0.449732125,0.498039216,0,0)
mov o0.w, r0.z
mov o1.w, r0.z
mov o2.xy, l(1.000000,0,0,0)
mov o2.w, r0.z
ret
// Approximately 211 instruction slots used
