//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:06:42 2022
//
//
// 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__batchData
// {
//
//   struct BatchDataDecal
//   {
//
//       float4x4 decalToWorld;         // Index:    0
//       float4x4 worldToDecal;         // Index:    4
//       float decalAlpha;              // Index:    8
//       float decalAngleStart;         // Index:    8.y
//       float decalAngleDivider;       // Index:    8.z
//       float PC_decalDepthBoundsMin;  // Index:    8.w
//       float PC_decalDepthBoundsMax;  // Index:    9
//
//   } resourceTables__batchData;       // Index:    0-9.x            Components:    37
//
// }
//
// 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
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// 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.layer_0__alpha    texture  float4          2d   11        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__batchData               cbuffer      NA          NA    2        1
// ConstBuf__viewData                cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyz
// VERT_ID                  0   x           1     NONE    uint   x
// TEXCOORD                 0   xy          2     NONE   float
// NORMAL                   0   xyz         3     NONE   float   xyz
// TANGENT                  0   xyz         4     NONE   float
// BINORMAL                 0   xyz         5     NONE   float
// TEXCOORD                 8   xyz         6     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[3], immediateIndexed
dcl_constantbuffer cb2[10], immediateIndexed
dcl_constantbuffer cb3[38], immediateIndexed
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_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps constant v1.x
dcl_input_ps linear v3.xyz
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
ne r0.x, l(1.000000), cb1[2].w
if_nz r0.x
  ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[37].x
  if_z r0.x
    and r0.x, v1.x, l(0x00ffffff)
    ftoi r0.yz, v0.xxyx
    iadd r0.x, r0.x, l(1)
    and r0.x, r0.x, l(7)
    imad r0.xy, r0.xxxx, l(7, 7, 0, 0), r0.yzyy
    and r0.xy, r0.xyxx, l(63, 63, 0, 0)
    and r0.z, l(7), cb3[37].z
    mov r0.w, l(0)
    ld_indexable(texture2darray)(float,float,float,float) r0.x, r0.xyzw, t8.xyzw
  else
    mov r0.x, l(0)
  endif
  ge r0.x, r0.x, cb1[2].w
  discard_nz r0.x
endif
mul r0.xy, v0.xyxx, cb3[32].zwzz
add r1.x, r0.x, r0.x
mad r2.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r0.zw, l(0.000000, 0.000000, 0.500000, 0.500000), cb3[32].zzzw
mad r1.yw, v0.xxxy, cb3[32].zzzw, -r0.zzzw
gather4_indexable(texture2d)(float,float,float,float) r3.xyz, r1.ywyy, t0.zxyw, s4.x
mov r2.z, -r2.y
mul r4.xy, r2.xzxx, r3.zzzz
mov r4.z, r3.z
mov r4.w, l(1.000000)

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

dp4 r5.x, r4.xyzw, cb3[12].xyzw
dp4 r5.y, r4.xyzw, cb3[13].xyzw
dp4 r5.z, r4.xyzw, cb3[14].xyzw
mov r5.w, l(1.000000)
dp4 r4.x, r5.xyzw, cb2[4].xyzw
dp4 r4.y, r5.xyzw, cb2[5].xyzw
dp4 r4.z, r5.xyzw, cb2[6].xyzw
add r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
lt r5.xyz, r4.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
or r1.y, r5.y, r5.x
lt r5.xyw, l(1.000000, 1.000000, 0.000000, 1.000000), r4.xyxz
or r1.y, r1.y, r5.x
or r1.y, r5.y, r1.y
or r1.y, r5.w, r1.y
or r1.y, r5.z, r1.y
if_z r1.y
  sample_indexable(texture2d)(float,float,float,float) r5.xyz, r0.xyxx, t1.xyzw, s4
  mad r5.xyz, r5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r0.x, r5.xyzx, r5.xyzx
  rsq r0.x, r0.x
  mul r5.xyz, r0.xxxx, r5.xyzx
  mad r0.xz, v0.xxyx, cb3[32].zzwz, r0.zzwz
  gather4_indexable(texture2d)(float,float,float,float) r0.xw, r0.xzxx, t0.xwyz, s4.x
  dp3 r1.y, cb2[5].xyzx, cb2[5].xyzx
  rsq r1.y, r1.y
  mul r6.xyz, r1.yyyy, cb2[5].xyzx
  dp3 r1.y, r5.xyzx, r6.xyzx
  add r1.y, r1.y, -cb2[8].y
  mul_sat r1.y, r1.y, cb2[8].z
  mul r1.y, r1.y, r1.y
  mul r5.z, r1.y, cb2[8].x
  lt r1.y, l(0.000000), r5.z
  add r2.yw, -r3.zzzz, r3.yyyx
  add r4.yw, -r3.zzzz, r0.wwwx
  lt r2.yw, |r2.yyyw|, |r4.yyyw|
  mov r6.x, r3.y
  mul r6.y, l(-2.000000), cb3[32].z
  mov r6.zw, l(0,0,1.000000,0)
  mov r7.x, r0.w
  mul r7.y, l(2.000000), cb3[32].z
  mov r7.zw, l(0,0,-1.000000,1.000000)
  movc r6.xyz, r2.yyyy, r6.xyzx, r7.xyzx
  mul r3.y, l(2.000000), cb3[32].w
  mov r3.zw, l(0,0,1.000000,-1.000000)
  mul r0.z, l(-2.000000), cb3[32].w
  mov r0.w, l(-1.000000)
  movc r3.xyz, r2.wwww, r3.xyzx, r0.xzwx
  add r0.xz, r2.xxzx, r6.yywy
  mul r2.xy, r6.xxxx, r0.xzxx
  mov r2.z, r6.x
  mov r2.w, l(1.000000)
  
add r40.w, r2.z, -r40.y
mad r2.x, -r40.x, r40.w, r2.x

dp4 r7.x, r2.xyzw, cb3[12].xyzw
  dp4 r7.y, r2.xyzw, cb3[13].xyzw
  dp4 r7.z, r2.xyzw, cb3[14].xyzw
  mad r1.z, -r0.y, l(2.000000), l(1.000000)
  add r0.xy, r1.xzxx, r3.wyww
  mul r0.xy, r3.xxxx, r0.xyxx
  mov r0.z, r3.x
  mov r0.w, l(1.000000)
  
add r40.w, r0.z, -r40.y
mad r0.x, -r40.x, r40.w, r0.x

dp4 r2.x, r0.xyzw, cb3[12].xyzw
  dp4 r2.y, r0.xyzw, cb3[13].xyzw
  dp4 r2.z, r0.xyzw, cb3[14].xyzw
  dp4 r0.x, r7.xyzw, cb2[4].xyzw
  dp4 r0.y, r7.xyzw, cb2[6].xyzw
  add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  mov r2.w, l(1.000000)
  dp4 r3.x, r2.xyzw, cb2[4].xyzw
  dp4 r3.y, r2.xyzw, cb2[6].xyzw
  add r0.zw, r3.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
  add r0.xyzw, -r0.xyzw, r4.xzxz
  mul r0.xy, r6.zzzz, r0.xyxx
  mul r5.xy, r3.zzzz, r0.zwzz
  and r0.xy, r0.xyxx, r1.yyyy
  and r1.xyz, r5.xyzx, r1.yyyy
else
  mov r0.xy, l(0,0,0,0)
  mov r1.xyz, l(0,0,0,0)
endif
ge r0.z, l(0.000000), r1.z
discard_nz r0.z
lt r0.z, v0.z, cb2[8].w
lt r0.w, cb2[9].x, v0.z
or r0.z, r0.w, r0.z
discard_nz r0.z
sample_d_indexable(texture2d)(float,float,float,float) r0.x, r4.xzxx, t11.xyzw, s2, r0.xyxx, r1.xyxx
add r0.x, r0.x, l(-0.281128)
mul_sat r0.x, r0.x, l(1.61164773)
mul r0.x, r1.z, r0.x
ge r0.y, l(0.000000), r0.x
discard_nz r0.y
dp3 r0.y, v3.xyzx, v3.xyzx
rsq r0.y, r0.y
mul r0.yzw, r0.yyyy, v3.xxyz
ne r1.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[36].z
deriv_rtx_fine r1.yzw, r0.yyzw
deriv_rty_fine r2.xyz, r0.yzwy
dp3 r1.y, r1.yzwy, r1.yzwy
dp3 r1.z, r2.xyzx, r2.xyzx
add r1.y, r1.z, r1.y
min r1.y, r1.y, l(0.300000)
add r1.y, r1.y, l(0.690984607)
sqrt r1.y, r1.y
sqrt r1.y, r1.y
add r1.y, -r1.y, l(1.000000)
movc o2.z, r1.x, l(0.0882682204), r1.y
mad o1.xyz, r0.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mov o0.xyz, l(0.802413225,0.498039216,0,0)
mov o0.w, r0.x
mov o1.w, r0.x
mov o2.xy, l(1.000000,0,0,0)
mov o2.w, r0.x
ret
// Approximately 141 instruction slots used
