//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:35 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__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.normalTexture    texture  float4          2d    1        1
// resourceTables__viewData.blueNoiseTexture    texture   float     2darray    8        1
// resourceTables__materialData.layer_0__diffuse    texture  float4          2d   11        1
// resourceTables__materialData.layer_0__normal    texture  float4          2d   12        1
// resourceTables__materialData.layer_0__gloss    texture  float4          2d   13        1
// resourceTables__materialData.layer_0__ao    texture  float4          2d   14        1
// resourceTables__materialData.layer_0__alpha    texture  float4          2d   15        1
// resourceTables__materialData.layer_2__diffuse    texture  float4          2d   16        1
// resourceTables__materialData.layer_2__normal    texture  float4          2d   17        1
// resourceTables__materialData.layer_2__gloss    texture  float4          2d   18        1
// resourceTables__materialData.layer_2__alpha    texture  float4          2d   21        1
// resourceTables__materialData.layer_3__alpha    texture  float4          2d   22        1
// ConstBuf__modelData               cbuffer      NA          NA    1        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   xy
// NORMAL                   0   xyz         3     NONE   float
// TANGENT                  0   xyz         4     NONE   float   xyz
// BINORMAL                 0   xyz         5     NONE   float   xyz
// 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 cb3[38], immediateIndexed
dcl_sampler s2, mode_default
dcl_sampler s4, mode_default
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_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t16
dcl_resource_texture2d (float,float,float,float) t17
dcl_resource_texture2d (float,float,float,float) t18
dcl_resource_texture2d (float,float,float,float) t21
dcl_resource_texture2d (float,float,float,float) t22
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps constant v1.x
dcl_input_ps linear v2.xy
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.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
mad r0.zw, r0.xxxy, l(0.000000, 0.000000, 2.000000, -2.000000), l(0.000000, 0.000000, -1.000000, 1.000000)
mad r1.x, v0.z, cb3[35].z, cb3[35].w
rcp r1.x, r1.x
mov r1.z, -r1.x
mul r1.xy, r0.zwzz, r1.zzzz
mov r1.w, l(1.000000)

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

dp4 r2.x, r1.xyzw, cb3[12].xyzw
dp4 r2.y, r1.xyzw, cb3[13].xyzw
dp4 r2.z, r1.xyzw, cb3[14].xyzw
add r1.xyz, -r2.xyzx, cb3[29].xyzx

//Tessellation specular PS..
mul r41.xyz, r40.yyyy, cb3[16].xyzx
mul r41.w, cb3[16].x, cb3[16].x
mad r41.w, cb3[16].y, cb3[16].y, r41.w
mad r41.w, cb3[16].z, cb3[16].z, r41.w
div r41.xyz, r41.xyzx, r41.wwww
mad r1.x, r40.x, r41.x, r1.x
mad r1.y, r40.x, r41.y, r1.y
mad r1.z, r40.x, r41.z, r1.z

dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.w, r0.z
mul r1.xyzw, v2.xyxy, l(3.000000, 3.000000, 6.000000, 6.000000)
mul r2.xy, v2.xyxx, l(7.000000, 7.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.z, v2.xyxx, t15.xywz, s2
mad r0.z, -r0.z, r0.w, l(120.000000)
mul_sat r0.z, r0.z, l(0.050000)
mad r0.z, r2.z, r0.z, l(-0.431373)
mul_sat r0.z, r0.z, l(2.125001)
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.xyxx, t11.xyzw, s2
lt r4.xyz, r3.xyzx, l(0.00313080009, 0.00313080009, 0.00313080009, 0.000000)
mul r5.xyz, r3.xyzx, l(12.920000, 12.920000, 12.920000, 0.000000)
log r3.xyz, r3.xyzx
mul r3.xyz, r3.xyzx, l(0.416666657, 0.416666657, 0.416666657, 0.000000)
exp r3.xyz, r3.xyzx
mad r3.xyz, r3.xyzx, l(1.055000, 1.055000, 1.055000, 0.000000), l(-0.055000, -0.055000, -0.055000, 0.000000)
movc r3.xyz, r4.xyzx, r5.xyzx, r3.xyzx
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r1.xyxx, t12.xyzw, s2
mad r4.xyz, r4.xyzx, l(2.007874, 2.007874, 2.007874, 0.000000), l(-1.007874, -1.007874, -1.007874, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.z, r1.xyxx, t13.zwxy, s2
sample_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t14.xywz, s2
dp3 r3.w, r4.xyzx, r4.xyzx
sqrt r3.w, r3.w
max r3.w, r3.w, l(0.000010)
rcp r4.w, r3.w
mul r4.xyz, r4.wwww, r4.xyzx
mul r3.xyz, r3.xyzx, l(0.607843, 0.580361426, 0.188235179, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r1.zwzz, t16.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t21.wxyz, s2
mul_sat r2.y, r5.w, l(42.500023)
mad r2.x, r2.x, r2.y, l(-0.334229)
mul_sat r2.x, r2.x, l(3.574173)
lt r2.y, l(0.000000), r2.x
if_nz r2.y
  lt r6.xyz, r5.xyzx, l(0.00313080009, 0.00313080009, 0.00313080009, 0.000000)
  mul r7.xyz, r5.xyzx, l(12.920000, 12.920000, 12.920000, 0.000000)
  log r5.xyz, r5.xyzx
  mul r5.xyz, r5.xyzx, l(0.416666657, 0.416666657, 0.416666657, 0.000000)
  exp r5.xyz, r5.xyzx
  mad r5.xyz, r5.xyzx, l(1.055000, 1.055000, 1.055000, 0.000000), l(-0.055000, -0.055000, -0.055000, 0.000000)
  movc r5.xyz, r6.xyzx, r7.xyzx, r5.xyzx
  sample_indexable(texture2d)(float,float,float,float) r6.xyz, r1.zwzz, t17.xyzw, s2
  mad r6.xyz, r6.xyzx, l(2.007874, 2.007874, 2.007874, 0.000000), l(-1.007874, -1.007874, -1.007874, 0.000000)
  sample_indexable(texture2d)(float,float,float,float) r1.zw, r1.zwzz, t18.ywxz, s2
  dp3 r2.y, r6.xyzx, r6.xyzx
  sqrt r2.y, r2.y
  max r2.y, r2.y, l(0.000010)
  rcp r4.w, r2.y
  mul r2.x, r2.x, l(0.300000)
  add r2.y, -r3.w, r2.y
  mad r3.w, r2.x, r2.y, r3.w
  mad r6.xyz, r6.xyzx, r4.wwww, -r4.xyzx
  mad r4.xyz, r2.xxxx, r6.xyzx, r4.xyzx
  mad r5.xyz, r5.xyzx, l(0.999999940, 0.999999940, 0.999999940, 0.000000), -r3.xyzx
  mad r3.xyz, r2.xxxx, r5.xyzx, r3.xyzx
  add r1.z, -r2.z, r1.z
  mad r2.z, r2.x, r1.z, r2.z
  add r1.z, -r0.w, l(1.000000)
  mad r0.w, r2.x, r1.z, r0.w
  mul r2.w, r1.w, r2.x
else
  mov r2.w, l(0)
endif
ge r1.z, l(0.000000), r0.z
discard_nz r1.z
mul r1.w, r0.z, l(0.700000)
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t1.xyzw, s4
mad r0.xyz, r0.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r2.x, r0.xyzx, r0.xyzx
rsq r2.x, r2.x
mul r0.xyz, r0.xyzx, r2.xxxx
sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t22.zxyw, s2
add r1.x, r1.x, l(-0.260254)
mul_sat r1.x, r1.x, l(12.749996)
add r1.x, -r1.x, l(1.000000)
mul r1.y, r1.x, l(0.500000)
add r2.xyw, -r2.zwzz, l(0.500000, 1.000000, 0.000000, 0.990000)
mul_sat r2.x, r2.x, l(2.500000)
mad r5.xy, r1.xxxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(-0.200000, -0.300000, 0.000000, 0.000000)
mul r5.xy, r5.xyxx, l(1.250000, 1.47058821, 0.000000, 0.000000)
max r5.xy, r5.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r1.x, r2.x, r5.x
mad r1.x, r1.x, l(0.600000), l(1.000000)
mul r2.x, r2.y, r5.y
mad r2.y, r2.x, r2.w, r2.z
max r2.x, r2.x, l(0.000000)
add r2.z, -r3.w, l(1.000000)
mad r5.x, r2.x, r2.z, r3.w
dp3 r2.x, r4.xyzx, r4.xyzx
rsq r2.x, r2.x
mul r2.xzw, r2.xxxx, r4.xxyz
add r3.w, -r0.w, l(1.000000)
mad o2.x, r1.y, r3.w, r0.w
log r3.xyzw, r3.xyzx
mul r3.xyzw, r1.xxxx, r3.xyzw
exp r3.xyzw, r3.xyzw
dp3 r0.w, v4.xyzx, v4.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, v4.xyzx
dp3 r0.w, v5.xyzx, v5.xyzx
rsq r0.w, r0.w
mul r6.xyz, r0.wwww, v5.xyzx
mul r6.xyz, r2.zzzz, r6.xyzx
mad r4.xyz, r2.xxxx, r4.xyzx, r6.xyzx
mad r2.xzw, r2.wwww, r0.xxyz, r4.xxyz
dp3 r0.w, r2.xzwx, r2.xzwx
rsq r0.w, r0.w
mul r2.xzw, r0.wwww, r2.xxzw
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[36].z
deriv_rtx_fine r4.xyz, r0.xyzx
deriv_rty_fine r0.xyz, r0.xyzx
dp3 r1.x, r4.xyzx, r4.xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
add r0.x, r0.x, r1.x
min r5.y, r0.x, l(0.300000)
movc r0.xy, r0.wwww, l(1.000000,0,0,0), r5.xyxx
add r0.z, -r2.y, l(1.000000)
mul r0.z, r0.z, r0.z
max r0.x, r0.x, l(0.600000)
mad r0.x, r0.x, l(-0.527635), l(0.520718)
max r0.x, r0.x, l(0.000000)
mad r0.x, r0.z, r0.z, r0.x
add r0.x, r0.y, r0.x
sqrt r0.x, r0.x
min r0.x, r0.x, l(1.000000)
max r0.x, r0.x, l(0.001000)
sqrt r0.x, r0.x
add o2.z, -r0.x, l(1.000000)
lt r0.xyzw, r3.wyzw, l(0.040450, 0.040450, 0.040450, 0.040450)
mul r4.xyzw, r3.wyzw, l(0.0773993805, 0.0773993805, 0.0773993805, 0.0773993805)
add r3.xyzw, r3.xyzw, l(0.055000, 0.055000, 0.055000, 0.055000)
mul r3.xyzw, r3.xyzw, l(0.947867334, 0.947867334, 0.947867334, 0.947867334)
log r3.xyzw, r3.xyzw
mul r3.xyzw, r3.xyzw, l(2.400000, 2.400000, 2.400000, 2.400000)
exp r3.xyzw, r3.xyzw
movc r0.xyzw, r0.xyzw, r4.xyzw, r3.xyzw
ftou r1.xy, v0.xyxx
sqrt r0.xyzw, r0.xyzw
mul r3.xyz, r0.xywx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r0.xy, r3.yyyy, r3.xzxx
mad r3.x, r0.z, l(0.250000), r0.x
dp2 r3.y, r0.wzww, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r3.z, r0.z, l(-0.250000), r0.y
and r0.xy, r1.xyxx, l(1, 1, 0, 0)
ine r0.x, r0.y, r0.x
movc r0.xy, r0.xxxx, r3.xyxx, r3.xzxx
add o0.xy, r0.xyxx, l(0.000000, 0.498039216, 0.000000, 0.000000)
mad o1.xyz, r2.xzwx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mov r1.z, l(0)
mov o0.zw, r1.zzzw
mov o1.w, r1.w
mov o2.yw, r1.zzzw
ret
// Approximately 183 instruction slots used
