//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:34 2022
//
//
// Buffer Definitions:
//
// 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
//
// }
//
// cbuffer ConstBuf__materialData
// {
//
//   struct MaterialData
//   {
//
//       float Base_Wisp_cst_AlphaReference;// Index:    0
//
//   } resourceTables__materialData;    // Index:    0.x              Components:     1
                                        // Textures:  t41-t49
//
// }
//
//
// 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__passData.depthTexture    texture  float4          2d    0        1
// resourceTables__materialData.material_dudv1    texture  float4          2d   41        1
// resourceTables__materialData.material_dudv2    texture  float4          2d   42        1
// resourceTables__materialData.Base_Wisp_normal    texture  float4          2d   43        1
// resourceTables__materialData.Base_Wisp_alpha    texture  float4          2d   45        1
// resourceTables__materialData.layer_2__alpha    texture  float4          2d   49        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   xyz
// VERT_ID                  0   x           1     NONE    uint
// 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
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb3[36], immediateIndexed
dcl_constantbuffer cb4[1], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t41
dcl_resource_texture2d (float,float,float,float) t42
dcl_resource_texture2d (float,float,float,float) t43
dcl_resource_texture2d (float,float,float,float) t45
dcl_resource_texture2d (float,float,float,float) t49
dcl_input_ps_siv linear noperspective v0.xyz, position
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_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
sample_indexable(texture2d)(float,float,float,float) r0.xy, v2.xyxx, t41.xyzw, s1
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-0.996078432, -0.996078432, 0.000000, 0.000000)
mul r0.zw, l(0.000000, 0.000000, 71.428566, 20.000000), cb3[35].xxxx
frc r0.zw, r0.zzzw
add r1.xy, r0.zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
add r1.zw, l(0.000000, 0.000000, 0.007000, 0.025000), cb3[35].xxxx
mul r1.zw, r1.zzzw, l(0.000000, 0.000000, 71.428566, 20.000000)
frc r1.zw, r1.zzzw
add r1.zw, r1.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r0.xyzw, r0.xyzw, l(1.500000, 1.500000, 6.28318548, 6.28318548)
sincos null, r0.zw, r0.zzzw
sample_indexable(texture2d)(float,float,float,float) r2.xy, v2.xyxx, t42.xyzw, s1
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-0.996078432, -0.996078432, 0.000000, 0.000000)
mul r2.xy, r2.xyxx, l(4.000000, 4.000000, 0.000000, 0.000000)
mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
mad r2.zw, r0.xxxy, r1.xxxx, v2.xxxy
mad r0.xy, r0.xyxx, r1.zzzz, v2.xyxx
mad r1.xy, r2.xyxx, r1.yyyy, v2.xyxx
mad r1.zw, r2.xxxy, r1.wwww, v2.xxxy
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.zwzz, t45.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r2.y, r0.xyxx, t45.yxzw, s2
add r2.y, -r2.x, r2.y
mad r2.x, r0.z, r2.y, r2.x
mad_sat r2.x, r2.x, v6.x, -cb4[0].x
sample_indexable(texture2d)(float,float,float,float) r2.yzw, r2.zwzz, t43.wxyz, s2
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r0.xyxx, t43.xyzw, s2
add r3.xyz, -r2.yzwy, r3.xyzx
mad r0.xyz, r0.zzzz, r3.xyzx, r2.yzwy
mad r0.xyz, r0.xyzx, l(2.007874, 2.007874, 2.007874, 0.000000), l(-1.007874, -1.007874, -1.007874, 0.000000)
dp3 r2.y, r0.xyzx, r0.xyzx
sqrt r2.y, r2.y
max r2.y, r2.y, l(0.000010)
rcp r2.y, r2.y
mul r3.xyz, r0.xyzx, r2.yyyy
sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t45.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r1.y, r1.zwzz, t45.yxzw, s2
add r1.y, -r1.x, r1.y
mad r0.w, r0.w, r1.y, r1.x
mul_sat r0.w, r0.w, v6.x
lt r1.x, l(0.000000), r0.w
if_nz r1.x
  mad r0.xyz, -r0.xyzx, r2.yyyy, l(0.000000, 0.000000, 1.000000, 0.000000)
  mad r3.xyz, r0.wwww, r0.xyzx, r3.xyzx
endif
mul r0.xy, v2.xyxx, l(2.000000, 1.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t49.yxzw, s2
mul_sat r0.x, r0.x, v6.x
lt r0.y, l(0.000000), r0.x
if_nz r0.y
  add r0.yzw, -r3.xxyz, l(0.000000, 0.000000, 0.000000, 1.000000)
  mad r3.xyz, r0.xxxx, r0.yzwy, r3.xyzx
endif
ge r0.x, l(0.000100), r2.x
discard_nz r0.x
mul r0.xy, v0.xyxx, cb3[32].zwzz
mad r0.xy, r0.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mad r0.z, v0.z, cb3[35].z, cb3[35].w
rcp r0.z, r0.z
mov r1.z, -r0.z
mul r1.xy, r0.xyxx, 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 r4.x, r1.xyzw, cb3[12].xyzw
dp4 r4.y, r1.xyzw, cb3[13].xyzw
dp4 r4.z, r1.xyzw, cb3[14].xyzw
dp3 r0.z, v3.xyzx, v3.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, v3.xyzx
dp3 r0.z, v4.xyzx, v4.xyzx
rsq r0.z, r0.z
mul r2.yzw, r0.zzzz, v4.xxyz
dp3 r0.z, v5.xyzx, v5.xyzx
rsq r0.z, r0.z
mul r5.xyz, r0.zzzz, v5.xyzx
dp3 r0.z, r3.xyzx, r3.xyzx
rsq r0.z, r0.z
mul r3.xyz, r0.zzzz, r3.xyzx
mul r5.xyz, r5.xyzx, r3.yyyy
mad r2.yzw, r3.xxxx, r2.yyzw, r5.xxyz
mad r1.xyz, r3.zzzz, r1.xyzx, r2.yzwy
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
ftoi r3.xy, v0.xyxx
mov r4.w, l(1.000000)
dp4 r0.z, r4.xyzw, cb3[2].xyzw
mov r3.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.w, r3.xyzw, t0.yzwx
add r0.w, r0.z, r0.w
mul_sat r0.w, r0.w, l(6.66666651)
lt r1.w, l(0.500000), r0.w
add r2.y, -r0.w, l(1.000000)
movc r0.w, r1.w, r2.y, r0.w
add r0.w, r0.w, r0.w
mul r2.y, r0.w, r0.w
mul r0.w, r0.w, r2.y
mul r2.y, r0.w, l(0.500000)
mad r0.w, -r0.w, l(0.500000), l(1.000000)
movc r0.w, r1.w, r0.w, r2.y
mul r0.w, r0.w, r2.x
add r2.xyz, -r4.xyzx, cb3[31].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 r2.x, r40.x, r41.x, r2.x
mad r2.y, r40.x, r41.y, r2.y
mad r2.z, r40.x, r41.z, r2.z

dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
dp3 r1.w, -r2.xyzx, r1.xyzx
add r1.w, r1.w, r1.w
mad r1.xyz, r1.xyzx, -r1.wwww, -r2.xyzx
mad r1.xyz, r1.xyzx, l(-0.233154, -0.233154, -0.233154, 0.000000), r4.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb3[16].xyzw
dp4 r2.y, r1.xyzw, cb3[17].xyzw
dp4 r1.x, r1.xyzw, cb3[19].xyzw

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

div r1.xy, r2.xyxx, r1.xxxx
add r1.xy, -r0.xyxx, r1.xyxx
mul r1.xy, r0.wwww, r1.xyxx
mul r0.xy, r0.xyxx, r0.xyxx
mul r0.xy, r0.xyxx, r0.xyxx
mad r0.xy, -r0.xyxx, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul o0.xy, r0.xyxx, r1.xyxx
mov o0.w, -r0.z
ftou r0.xy, v0.xyxx
and r0.xy, r0.xyxx, l(1, 1, 0, 0)
ine r0.x, r0.y, r0.x
and o0.z, r0.x, l(0xbf800000)
ret
// Approximately 124 instruction slots used
