//Volumetric lighting CS from cache.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Fri Jan 14 20:06:33 2022
//
//
// Note: shader requires additional functionality:
//       64 UAV slots
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__volumetricFogData
// {
//
//   struct VolumetricFogData
//   {
//
//       float4 cPoissonSamples[64];    // Index:    0
//       float4x4 cInvViewProjMatrixNoZReproj;// Index:   64
//       float4x4 cReprojToPreviousFrame;// Index:   68
//       float4 cWorldEyePos;           // Index:   72
//       float4x4 cGIVolumeTransform;   // Index:   73
//       float4 cGIVolumeStart;         // Index:   77
//       float4 cGIVolumeTexelScale;    // Index:   78
//
//       struct AtmosphericConstants
//       {
//
//           float3 cFogColor;          // Index:   79
//           float cHeightFalloff;      // Index:   79.w
//           float3 cEyePosition;       // Index:   80
//           float cHeightDensity;      // Index:   80.w
//           float cStartDistance;      // Index:   81
//           float cGlobalDensity;      // Index:   81.y
//           float cDepthReprojectScale;// Index:   81.z
//           float cDepthReprojectBias; // Index:   81.w
//           float4x4 cInvProjNoZReproj;// Index:   82
//           float3 cDirectionalFogDirection;// Index:   86
//           float cDirectionalityPower;// Index:   86.w
//           float3 cDirectionalFogColor;// Index:   87
//           float cDensityMapSparseBias;// Index:   87.w
//           float3 cDensityMapInvExtents;// Index:   88
//           float cDensityMapSparseSegmentScale;// Index:   88.w
//           float3 cDensityMapBias;    // Index:   89
//           float cDensityMapSparseCutoff;// Index:   89.w
//           float cVolFogExponentMultiply;// Index:   90
//           float cVolFogDistanceMultiply;// Index:   90.y
//           float cVolFogExponentNormalize;// Index:   90.z
//           float cVolFogDistanceNormalize;// Index:   90.w
//           float cVolFogResolutionScale;// Index:   91
//           int cVolFogWidth;          // Index:   91.y
//           int cVolFogHeight;         // Index:   91.z
//           int cVolFogDepth;          // Index:   91.w
//
//       } atmosphericConstants;        // Index:   79
//       float3 cFogAlbedo;             // Index:   92
//       float cLightingTemporal;       // Index:   92.w
//       float cDensityTemporal;        // Index:   93
//       float cPrevFogResolutionScale; // Index:   93.y
//       float CascadeShadowSize;       // Index:   93.z
//       float OneOverCascadeShadowSize;// Index:   93.w
//       float ShadowTextureW;          // Index:   94
//       float ShadowTextureH;          // Index:   94.y
//       float OneOverShadowTextureW;   // Index:   94.z
//       float OneOverShadowTextureH;   // Index:   94.w
//
//   } resourceTables__volumetricFogData;// Index:    0-94             Components:   380
                                        // Textures:  t0-t1
//
// }
//
// cbuffer ConstBuf__volumetricFogDensityData
// {
//
//   struct VolumetricFogDensityData
//   {
//
//       struct AtmosphericConstants
//       {
//
//           float3 cFogColor;          // Index:    0
//           float cHeightFalloff;      // Index:    0.w
//           float3 cEyePosition;       // Index:    1
//           float cHeightDensity;      // Index:    1.w
//           float cStartDistance;      // Index:    2
//           float cGlobalDensity;      // Index:    2.y
//           float cDepthReprojectScale;// Index:    2.z
//           float cDepthReprojectBias; // Index:    2.w
//           float4x4 cInvProjNoZReproj;// Index:    3
//           float3 cDirectionalFogDirection;// Index:    7
//           float cDirectionalityPower;// Index:    7.w
//           float3 cDirectionalFogColor;// Index:    8
//           float cDensityMapSparseBias;// Index:    8.w
//           float3 cDensityMapInvExtents;// Index:    9
//           float cDensityMapSparseSegmentScale;// Index:    9.w
//           float3 cDensityMapBias;    // Index:   10
//           float cDensityMapSparseCutoff;// Index:   10.w
//           float cVolFogExponentMultiply;// Index:   11
//           float cVolFogDistanceMultiply;// Index:   11.y
//           float cVolFogExponentNormalize;// Index:   11.z
//           float cVolFogDistanceNormalize;// Index:   11.w
//           float cVolFogResolutionScale;// Index:   12
//           int cVolFogWidth;          // Index:   12.y
//           int cVolFogHeight;         // Index:   12.z
//           int cVolFogDepth;          // Index:   12.w
//
//       } atmosphericConstants;        // Index:    0
//
//       struct FogDensityMapConstants
//       {
//
//           float4x4 cMatrix;          // Index:   13
//           float cStartDistance;      // Index:   17
//           float cStartDistanceRcp;   // Index:   17.y
//           float cFogVerticalAttenuation;// Index:   17.z
//           float cDensityHeightStart; // Index:   17.w
//           float cDensityHeightScale; // Index:   18
//           float cGlobalDensityScale; // Index:   18.y
//           float cVolumetricFogScattering;// Index:   18.z
//           float cFlowMap0Scale;      // Index:   18.w
//           float cFlowMap1Scale;      // Index:   19
//           float cFlowMap0Weight;     // Index:   19.y
//           float cFlowMap1Weight;     // Index:   19.z
//           int cFlowMapEnabled;       // Index:   19.w
//           float cLocalWeight;        // Index:   20
//
//       } fogDensityMapConstants;      // Index:   13
//       float cStartDistance;          // Index:   20.y
//       float cStartDistanceRcp;       // Index:   20.z
//       float cVolumetricFogScattering;// Index:   20.w
//       float cVolumetricFogAbsorption;// Index:   21
//       float cFogVerticalAttenuation; // Index:   21.y
//       float3 cWorldEyePos;           // Index:   22
//       float cVerticalFalloffRelativePosTimesAttenuation;// Index:   22.w
//       float cVerticalFalloffRelativePos;// Index:   23
//       float cVolumetricFogTransmittanceFade;// Index:   23.y
//
//   } resourceTables__volumetricFogDensityData;// Index:    0-23.y           Components:    94
                                        // Textures:  t8-t11
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__volumetricFogData__smpLinear    sampler      NA          NA    1        1
// resourceTables__volumetricFogDensityData__smpLinearBorder    sampler      NA          NA    7        1
// resourceTables__volumetricFogData.OpticalDensityTextureAccum    texture  float2          3d    1        1
// resourceTables__volumetricFogDensityData.PC_ParticleDensityTexture    texture   float          3d   10        1
// resourceTables__volumetricFogDensityData.PC_ParticleScatterTexture    texture   float          3d   11        1
// resourceTables__volumetricFogData.OutOpticalDensityTexture        UAV  float2          3d    9        1
// ConstBuf__volumetricFogData       cbuffer      NA          NA    0        1
// ConstBuf__volumetricFogDensityData    cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[94], dynamicIndexed
dcl_constantbuffer cb1[23], immediateIndexed
dcl_constantbuffer cb12[3], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture3d (float,float,float,float) t10
dcl_resource_texture3d (float,float,float,float) t11
dcl_uav_typed_texture3d (float,float,float,float) u9
dcl_input vThreadIDInGroupFlattened
dcl_input vThreadGroupID.xyz
dcl_temps 50
dcl_thread_group 4, 4, 4
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture2d)(float,float,float,float) r41.xyzw, l(2, 0, 0, 0), t125.xyzw
ishl r0.x, vThreadIDInGroupFlattened.x, l(1)
ushr r0.xy, l(0xebfa5014, 0xfa4141af, 0, 0), r0.xxxx
and r0.xy, r0.xyxx, l(3, 3, 0, 0)
ushr r0.zw, vThreadIDInGroupFlattened.xxxx, l(0, 0, 4, 4)
imad r0.xyzw, vThreadGroupID.xyzz, l(4, 4, 4, 4), r0.xyzw
utof r1.xyz, r0.xywx
mov r1.w, vThreadIDInGroupFlattened.x
add r2.xyz, r1.xyzx, cb0[r1.w + 0].xyzx
add r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
mul r1.xyz, r1.xyzx, l(2.000000, -2.000000, 1.000000, 0.000000)
mul r2.xyz, r2.xyzx, l(2.000000, -2.000000, 1.000000, 0.000000)
itof r3.xyz, cb0[91].yzwy
mul r4.xyz, r3.xyzx, cb0[91].xxxx
div r3.xyz, l(0.500000, 0.500000, 0.500000, 0.000000), r3.xyzx
div r2.xyz, r2.xyzx, r4.xyzx
div r1.xyz, r1.xyzx, r4.xyzx
add r2.xyz, r2.xyzx, l(-1.000000, 1.000000, 0.000000, 0.000000)
mul r1.w, r2.z, cb0[90].x
exp r1.w, r1.w
add r1.xyzw, r1.xyzw, l(-1.000000, 1.000000, 0.000000, -1.000000)
mul r4.z, r1.w, cb0[90].y
mul r4.xy, r2.xyxx, 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, cb0[64].xyzw
dp4 r2.z, r4.xyzw, cb0[66].xyzw
dp4 r2.y, r4.xyzw, cb0[65].xyzw
mad r4.xyz, r2.xyzx, cb1[9].xyzx, cb1[10].xyzx
add r2.xzw, r2.xxyz, -cb0[72].xxyz
mad r1.w, -r2.y, cb1[21].y, cb1[22].w
exp r1.w, r1.w
min r1.w, r1.w, l(1.000000)
dp3 r2.x, r2.xzwx, r2.xzwx
max r2.x, r2.x, l(0.000001)
lt r2.yzw, l(0.000000, 0.000000, 0.000000, 0.000000), r4.xxyz
lt r5.xyz, r4.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
iadd r2.yzw, -r2.yyzw, r5.xxyz
itof r2.yzw, r2.yyzw
mul r2.yzw, r2.yyzw, cb1[8].wwww
mad r2.yzw, cb1[9].wwww, r4.xxyz, r2.yyzw
lt r5.xyz, |r4.xyzx|, cb1[10].wwww
movc r2.yzw, r5.xxyz, r4.xxyz, r2.yyzw
mad r2.yzw, r2.yyzw, l(0.000000, 0.496093750, 0.496093750, 0.496093750), l(0.000000, 0.500000, 0.500000, 0.500000)
sample_l_indexable(texture3d)(float,float,float,float) r3.w, r2.yzwy, t11.yzwx, s7, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r4.y, r2.yzwy, t10.yxzw, s7, l(0.000000)
mov r4.xzw, r3.wwww
add_sat r4.xyzw, r4.xyzw, l(-1.000000, -1.000000, -1.000000, -1.000000)
rsq r2.y, r2.x
mul r2.x, r2.y, r2.x
mad_sat r2.x, r2.x, cb1[20].z, l(-1.000000)
mul r1.w, r1.w, r2.x
mul r2.xzw, r1.wwww, cb1[20].wwww
mul r2.y, r1.w, cb1[21].x
mad r2.xyzw, r4.xyzw, l(2048.000000, 2048.000000, 2048.000000, 2048.000000), r2.xyzw
mul r1.z, r1.z, cb0[90].x
exp r1.z, r1.z
add r1.z, r1.z, l(-1.000000)
mul r4.z, r1.z, cb0[90].y
mul r4.xy, r1.xyxx, 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 r1.x, r4.xyzw, cb0[68].xyzw
dp4 r1.y, r4.xyzw, cb0[69].xyzw
dp4 r1.z, r4.xyzw, cb0[70].xyzw

ge r42.x, r41.x, l(5.0)
if_z r42.x
add r40.w, r1.z, -cb12[2].y
mad r1.x, cb12[2].x, r40.w, r1.x
else
add r40.w, r1.z, -r40.y
mad r1.x, r40.x, r40.w, r1.x
endif

div r1.xy, r1.xyxx, r1.zzzz
mad r4.xy, r1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
lt r1.xy, |r1.xyxx|, l(1.000000, 1.000000, 0.000000, 0.000000)
and r1.x, r1.y, r1.x
and r1.x, r1.x, l(0x3f800000)
mul r1.x, r1.x, cb0[93].x
mad r1.y, r1.z, cb0[90].w, l(1.000000)
mul_sat r1.z, r1.z, l(1000.000000)
mul r1.x, r1.z, r1.x
log r1.y, r1.y
mul r4.z, r1.y, cb0[90].z
mul r1.yzw, r4.xxyz, cb0[93].yyyy
max r1.yzw, r3.xxyz, r1.yyzw
add r3.xyz, -r3.xyzx, cb0[93].yyyy
min r1.yzw, r1.yyzw, r3.xxyz
sample_l_indexable(texture3d)(float,float,float,float) r1.yz, r1.yzwy, t1.zxyw, s1, l(0.000000)
add r3.xyzw, -r2.wyww, r1.yzyy
mad r1.xyzw, r1.xxxx, r3.xyzw, r2.xyzw
store_uav_typed u9.xyzw, r0.xyzw, r1.xyzw
ret
// Approximately 82 instruction slots used
