//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.27 on Mon Feb 08 02:06:23 2016
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64 [unused]
//   row_major float4x4 ScreenMatrix;   // Offset:   64 Size:    64 [unused]
//   float2 DepthExportScale;           // Offset:  128 Size:     8 [unused]
//   float2 __padding0;                 // Offset:  136 Size:     8 [unused]
//   float4 FogParams;                  // Offset:  144 Size:    16 [unused]
//   float3 __CameraPosition;           // Offset:  160 Size:    12 [unused]
//   float __padding12;                 // Offset:  172 Size:     4 [unused]
//   float3 CameraDirection;            // Offset:  176 Size:    12 [unused]
//   float __padding9;                  // Offset:  188 Size:     4 [unused]
//   float3 DepthFactors;               // Offset:  192 Size:    12 [unused]
//   float __padding10;                 // Offset:  204 Size:     4 [unused]
//   float3 ShadowDepthBiasAndLightType;// Offset:  208 Size:    12 [unused]
//   float __padding11;                 // Offset:  220 Size:     4 [unused]
//   float4 SubframeViewport;           // Offset:  224 Size:    16 [unused]
//   row_major float3x4 DepthToWorld;   // Offset:  240 Size:    48 [unused]
//   float4 DepthToView;                // Offset:  288 Size:    16
//   float4 OneOverDepthToView;         // Offset:  304 Size:    16 [unused]
//   float4 DepthToW;                   // Offset:  320 Size:    16
//   float4 ClipPlane;                  // Offset:  336 Size:    16 [unused]
//   float2 ViewportDepthScaleOffset;   // Offset:  352 Size:     8 [unused]
//   float2 __padding1;                 // Offset:  360 Size:     8 [unused]
//   float2 ColorDOFDepthScaleOffset;   // Offset:  368 Size:     8 [unused]
//   float2 __padding2;                 // Offset:  376 Size:     8 [unused]
//   float4 TimeVector;                 // Offset:  384 Size:    16 [unused]
//   float4 FogParams2;                 // Offset:  400 Size:    16 [unused]
//   float4 FogParams3;                 // Offset:  416 Size:    16 [unused]
//   float3 GlobalAmbient;              // Offset:  432 Size:    12 [unused]
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256 [unused]
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16 [unused]
//   float2 ScreenResolution;           // Offset:  736 Size:     8 [unused]
//   float2 __padding3;                 // Offset:  744 Size:     8 [unused]
//   float4 PSSMToMap1Lin;              // Offset:  752 Size:    16 [unused]
//   float4 PSSMToMap1Const;            // Offset:  768 Size:    16 [unused]
//   float4 PSSMToMap2Lin;              // Offset:  784 Size:    16 [unused]
//   float4 PSSMToMap2Const;            // Offset:  800 Size:    16 [unused]
//   float4 PSSMToMap3Lin;              // Offset:  816 Size:    16 [unused]
//   float4 PSSMToMap3Const;            // Offset:  832 Size:    16 [unused]
//   float4 PSSMDistances;              // Offset:  848 Size:    16 [unused]
//   row_major float4x4 WorldToPSSM0;   // Offset:  864 Size:    64 [unused]
//   row_major float4x4 PrevViewProject;// Offset:  928 Size:    64 [unused]
//   row_major float4x4 PrevWorld;      // Offset:  992 Size:    64 [unused]
//   row_major float4x4 ViewT;          // Offset: 1056 Size:    64 [unused]
//   float4 PSSMExtents;                // Offset: 1120 Size:    16 [unused]
//   float4 ShadowAtlasResolution;      // Offset: 1136 Size:    16 [unused]
//   float4 UnitRimData[3];             // Offset: 1152 Size:    48 [unused]
//   float3 __CameraPositionForCorrection;// Offset: 1200 Size:    12 [unused]
//   float __padding7;                  // Offset: 1212 Size:     4 [unused]
//   row_major float4x4 CameraViewProject;// Offset: 1216 Size:    64 [unused]
//   float4 BackBufferResolution;       // Offset: 1280 Size:    16 [unused]
//   row_major float4x4 InverseProjection;// Offset: 1296 Size:    64 [unused]
//   float4 StereoOffset;               // Offset: 1360 Size:    16 [unused]
//   row_major float4x4 Projection;     // Offset: 1376 Size:    64 [unused]
//   row_major float4x4 ViewInv;        // Offset: 1440 Size:    64 [unused]
//   float4 ColorSSAO;                  // Offset: 1504 Size:    16 [unused]
//   float4 GlobalFogColor;             // Offset: 1520 Size:    16 [unused]
//   float4 VolumetricLightGlobalParams;// Offset: 1536 Size:    16 [unused]
//   float4 SnowParams01;               // Offset: 1552 Size:    16 [unused]
//   float4 SnowParams02;               // Offset: 1568 Size:    16 [unused]
//   float4 SnowParams03;               // Offset: 1584 Size:    16 [unused]
//   int SSREnabled;                    // Offset: 1600 Size:     4 [unused]
//   int __padding4;                    // Offset: 1604 Size:     4 [unused]
//   int __padding5;                    // Offset: 1608 Size:     4 [unused]
//   int __padding6;                    // Offset: 1612 Size:     4 [unused]
//
// }
//
// cbuffer GlobalConstantBuffer
// {
//
//   float2 g_AOResolution;             // Offset:    0 Size:     8 [unused]
//   float2 g_InvAOResolution;          // Offset:    8 Size:     8
//   float2 g_FocalLen;                 // Offset:   16 Size:     8 [unused]
//   float2 g_InvFocalLen;              // Offset:   24 Size:     8 [unused]
//   float2 g_UVToViewA;                // Offset:   32 Size:     8 [unused]
//   float2 g_UVToViewB;                // Offset:   40 Size:     8 [unused]
//   float g_R;                         // Offset:   48 Size:     4 [unused]
//   float g_R2;                        // Offset:   52 Size:     4
//   float g_NegInvR2;                  // Offset:   56 Size:     4 [unused]
//   float g_MaxRadiusPixels;           // Offset:   60 Size:     4 [unused]
//   float g_AngleBias;                 // Offset:   64 Size:     4 [unused]
//   float g_TanAngleBias;              // Offset:   68 Size:     4
//   float g_PowExponent;               // Offset:   72 Size:     4 [unused]
//   float g_Strength;                  // Offset:   76 Size:     4 [unused]
//   float LinA;                        // Offset:   80 Size:     4 [unused]
//   float LinB;                        // Offset:   84 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// depthBuffer                       texture   float          2d    0        1
// nextAoBuffer                          UAV   float          2d    0        1
// SceneBuffer                       cbuffer      NA          NA    0        1
// GlobalConstantBuffer              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[21], immediateIndexed
dcl_constantbuffer cb1[5], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t0
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_input vThreadIDInGroupFlattened
dcl_input vThreadGroupID.xy
dcl_temps 5
dcl_tgsm_structured g0, 8, 352
dcl_thread_group 320, 1, 1
resinfo_indexable(texture2d)(float,float,float,float)_uint r0.xy, l(0), t0.xyzw
resinfo_indexable(texture2d)(float,float,float,float)_uint r0.zw, l(0), u0.zwxy
ieq r0.xy, r0.xyxx, r0.zwzz
and r0.x, r0.y, r0.x
iadd r0.yw, r0.zzzz, l(0, -1, 0, 15)
movc r0.x, r0.x, l(1), l(2)
mov r1.y, vThreadGroupID.y
mov r2.zw, l(0,0,0,0)
mov r1.z, vThreadIDInGroupFlattened.x
loop 
  uge r1.w, r1.z, l(352)
  breakc_nz r1.w
  imad r1.w, vThreadGroupID.x, l(320), r1.z
  ult r3.x, r1.w, l(16)
  uge r3.y, r1.w, r0.w
  iadd r1.w, r1.w, l(-16)
  movc r1.w, r3.y, r0.y, r1.w
  movc r1.x, r3.x, l(0), r1.w
  itof r1.w, r1.x
  add r1.w, r1.w, l(0.500000)
  mul r1.w, r1.w, cb1[0].z
  imul null, r2.xy, r0.xxxx, r1.xyxx
  ld_indexable(texture2d)(float,float,float,float) r1.x, r2.xyzw, t0.xyzw
  mad r1.x, r1.x, cb0[20].x, cb0[20].y
  div r2.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
  mad r1.x, r1.w, cb0[18].x, cb0[18].z
  mul r2.x, r2.y, r1.x
  store_structured g0.xy, r1.z, l(0), r2.xyxx
  iadd r1.z, r1.z, l(320)
endloop 
sync_g_t
imad r1.x, vThreadGroupID.x, l(320), vThreadIDInGroupFlattened.x
ult r0.x, r1.x, r0.z
if_nz r0.x
  iadd r0.xyzw, vThreadIDInGroupFlattened.xxxx, l(16, 17, 15, 18)
  ld_structured r2.xy, r0.x, l(0), g0.xyxx
  ld_structured r0.xy, r0.y, l(0), g0.xyxx
  ld_structured r2.zw, r0.z, l(0), g0.xxxy
  add r0.xy, -r2.xyxx, r0.xyxx
  add r2.zw, -r2.zzzw, r2.xxxy
  dp2 r0.z, r0.xyxx, r0.xyxx
  dp2 r3.x, r2.zwzz, r2.zwzz
  lt r0.z, r0.z, r3.x
  movc r0.xy, r0.zzzz, r0.xyxx, r2.zwzz
  add r0.x, |r0.x|, l(0.000001)
  div r0.x, -r0.y, r0.x
  add r3.y, r0.x, cb1[4].y
  mad r0.y, r3.y, r3.y, l(1.000000)
  rsq r0.y, r0.y
  mul r3.z, r0.y, r3.y
  ld_structured r0.yz, r0.w, l(0), g0.xxyx
  add r0.yz, -r2.xxyx, r0.yyzy
  add r0.w, |r0.y|, l(0.000001)
  div r4.y, -r0.z, r0.w
  dp2 r0.y, r0.yzyy, r0.yzyy
  lt r0.y, r0.y, cb1[3].y
  lt r0.z, r3.y, r4.y
  and r0.y, r0.z, r0.y
  mad r0.z, r4.y, r4.y, l(1.000000)
  rsq r0.z, r0.z
  mul r4.z, r0.z, r4.y
  mad r4.x, r4.y, r0.z, -r3.z
  mov r3.x, l(0)
  movc r0.yzw, r0.yyyy, r4.xxyz, r3.xxyz
  iadd r3.xyzw, vThreadIDInGroupFlattened.xxxx, l(20, 22, 24, 26)
  ld_structured r2.zw, r3.x, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r4.y
  and r2.z, r2.w, r2.z
  mad r2.w, r4.y, r4.y, l(1.000000)
  rsq r2.w, r2.w
  mul r4.z, r2.w, r4.y
  mad r2.w, r4.y, r2.w, -r0.w
  mad r4.x, r2.w, l(0.940612078), r0.y
  movc r0.yzw, r2.zzzz, r4.xxyz, r0.yyzw
  ld_structured r2.zw, r3.y, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r4.y
  and r2.z, r2.w, r2.z
  mad r2.w, r4.y, r4.y, l(1.000000)
  rsq r2.w, r2.w
  mul r4.z, r2.w, r4.y
  mad r2.w, r4.y, r2.w, -r0.w
  mad r4.x, r2.w, l(0.782784402), r0.y
  movc r0.yzw, r2.zzzz, r4.xxyz, r0.yyzw
  ld_structured r2.zw, r3.z, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r3.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r3.y
  and r2.z, r2.w, r2.z
  mad r2.w, r3.y, r3.y, l(1.000000)
  rsq r2.w, r2.w
  mul r3.z, r2.w, r3.y
  mad r2.w, r3.y, r2.w, -r0.w
  mad r3.x, r2.w, l(0.576361418), r0.y
  movc r0.yzw, r2.zzzz, r3.xxyz, r0.yyzw
  ld_structured r2.zw, r3.w, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r3.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r3.y
  and r2.z, r2.w, r2.z
  mad r2.w, r3.y, r3.y, l(1.000000)
  rsq r2.w, r2.w
  mul r3.z, r2.w, r3.y
  mad r2.w, r3.y, r2.w, -r0.w
  mad r3.x, r2.w, l(0.375464261), r0.y
  movc r0.yzw, r2.zzzz, r3.xxyz, r0.yyzw
  iadd r3.xyzw, vThreadIDInGroupFlattened.xxxx, l(28, 30, 32, 14)
  ld_structured r2.zw, r3.x, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r4.y
  and r2.z, r2.w, r2.z
  mad r2.w, r4.y, r4.y, l(1.000000)
  rsq r2.w, r2.w
  mul r4.z, r2.w, r4.y
  mad r2.w, r4.y, r2.w, -r0.w
  mad r4.x, r2.w, l(0.216403142), r0.y
  movc r0.yzw, r2.zzzz, r4.xxyz, r0.yyzw
  ld_structured r2.zw, r3.y, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r2.w, r0.z, r4.y
  and r2.z, r2.w, r2.z
  mad r2.w, r4.y, r4.y, l(1.000000)
  rsq r2.w, r2.w
  mul r4.z, r2.w, r4.y
  mad r2.w, r4.y, r2.w, -r0.w
  mad r4.x, r2.w, l(0.110351838), r0.y
  movc r0.yzw, r2.zzzz, r4.xxyz, r0.yyzw
  ld_structured r2.zw, r3.z, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r3.x, |r2.z|, l(0.000001)
  div r3.x, -r2.w, r3.x
  dp2 r2.z, r2.zwzz, r2.zwzz
  lt r2.z, r2.z, cb1[3].y
  lt r0.z, r0.z, r3.x
  and r0.z, r0.z, r2.z
  mad r2.z, r3.x, r3.x, l(1.000000)
  rsq r2.z, r2.z
  mad r0.w, r3.x, r2.z, -r0.w
  mad r0.w, r0.w, l(0.0497870743), r0.y
  movc r3.x, r0.z, r0.w, r0.y
  add r3.y, -r0.x, cb1[4].y
  mad r0.x, r3.y, r3.y, l(1.000000)
  rsq r0.x, r0.x
  mul r3.z, r0.x, r3.y
  ld_structured r0.xy, r3.w, l(0), g0.xyxx
  add r0.xy, -r2.xyxx, r0.xyxx
  add r0.z, |r0.x|, l(0.000001)
  div r4.y, -r0.y, r0.z
  dp2 r0.x, r0.xyxx, r0.xyxx
  lt r0.x, r0.x, cb1[3].y
  lt r0.y, r3.y, r4.y
  and r0.x, r0.y, r0.x
  mad r0.y, r4.y, r4.y, l(1.000000)
  rsq r0.y, r0.y
  mul r4.z, r0.y, r4.y
  mad r0.y, r4.y, r0.y, -r3.z
  add r4.x, r0.y, r3.x
  movc r0.xyz, r0.xxxx, r4.xyzx, r3.xyzx
  iadd r3.xyzw, vThreadIDInGroupFlattened.xxxx, l(12, 10, 8, 6)
  ld_structured r2.zw, r3.x, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r0.w, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r0.w
  dp2 r0.w, r2.zwzz, r2.zwzz
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r4.y
  and r0.w, r0.w, r2.z
  mad r2.z, r4.y, r4.y, l(1.000000)
  rsq r2.z, r2.z
  mul r4.z, r2.z, r4.y
  mad r2.z, r4.y, r2.z, -r0.z
  mad r4.x, r2.z, l(0.940612078), r0.x
  movc r0.xyz, r0.wwww, r4.xyzx, r0.xyzx
  ld_structured r2.zw, r3.y, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r0.w, |r2.z|, l(0.000001)
  div r4.y, -r2.w, r0.w
  dp2 r0.w, r2.zwzz, r2.zwzz
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r4.y
  and r0.w, r0.w, r2.z
  mad r2.z, r4.y, r4.y, l(1.000000)
  rsq r2.z, r2.z
  mul r4.z, r2.z, r4.y
  mad r2.z, r4.y, r2.z, -r0.z
  mad r4.x, r2.z, l(0.782784402), r0.x
  movc r0.xyz, r0.wwww, r4.xyzx, r0.xyzx
  ld_structured r2.zw, r3.z, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r0.w, |r2.z|, l(0.000001)
  div r3.y, -r2.w, r0.w
  dp2 r0.w, r2.zwzz, r2.zwzz
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r3.y
  and r0.w, r0.w, r2.z
  mad r2.z, r3.y, r3.y, l(1.000000)
  rsq r2.z, r2.z
  mul r3.z, r2.z, r3.y
  mad r2.z, r3.y, r2.z, -r0.z
  mad r3.x, r2.z, l(0.576361418), r0.x
  movc r0.xyz, r0.wwww, r3.xyzx, r0.xyzx
  ld_structured r2.zw, r3.w, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r0.w, |r2.z|, l(0.000001)
  div r3.y, -r2.w, r0.w
  dp2 r0.w, r2.zwzz, r2.zwzz
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r3.y
  and r0.w, r0.w, r2.z
  mad r2.z, r3.y, r3.y, l(1.000000)
  rsq r2.z, r2.z
  mul r3.z, r2.z, r3.y
  mad r2.z, r3.y, r2.z, -r0.z
  mad r3.x, r2.z, l(0.375464261), r0.x
  movc r0.xyz, r0.wwww, r3.xyzx, r0.xyzx
  iadd r2.zw, vThreadIDInGroupFlattened.xxxx, l(0, 0, 4, 2)
  ld_structured r3.xy, r2.z, l(0), g0.xyxx
  add r3.xy, -r2.xyxx, r3.xyxx
  add r0.w, |r3.x|, l(0.000001)
  div r4.y, -r3.y, r0.w
  dp2 r0.w, r3.xyxx, r3.xyxx
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r4.y
  and r0.w, r0.w, r2.z
  mad r2.z, r4.y, r4.y, l(1.000000)
  rsq r2.z, r2.z
  mul r4.z, r2.z, r4.y
  mad r2.z, r4.y, r2.z, -r0.z
  mad r4.x, r2.z, l(0.216403142), r0.x
  movc r0.xyz, r0.wwww, r4.xyzx, r0.xyzx
  ld_structured r2.zw, r2.w, l(0), g0.xxxy
  add r2.zw, -r2.xxxy, r2.zzzw
  add r0.w, |r2.z|, l(0.000001)
  div r3.y, -r2.w, r0.w
  dp2 r0.w, r2.zwzz, r2.zwzz
  lt r0.w, r0.w, cb1[3].y
  lt r2.z, r0.y, r3.y
  and r0.w, r0.w, r2.z
  mad r2.z, r3.y, r3.y, l(1.000000)
  rsq r2.z, r2.z
  mul r3.z, r2.z, r3.y
  mad r2.z, r3.y, r2.z, -r0.z
  mad r3.x, r2.z, l(0.110351838), r0.x
  movc r0.xyz, r0.wwww, r3.xyzx, r0.xyzx
  ld_structured r2.zw, vThreadIDInGroupFlattened.x, l(0), g0.xxxy
  add r2.xy, -r2.xyxx, r2.zwzz
  add r0.w, |r2.x|, l(0.000001)
  div r0.w, -r2.y, r0.w
  dp2 r2.x, r2.xyxx, r2.xyxx
  lt r2.x, r2.x, cb1[3].y
  lt r0.y, r0.y, r0.w
  and r0.y, r0.y, r2.x
  mad r2.x, r0.w, r0.w, l(1.000000)
  rsq r2.x, r2.x
  mad r0.z, r0.w, r2.x, -r0.z
  mad r0.z, r0.z, l(0.0497870743), r0.x
  movc r0.x, r0.y, r0.z, r0.x
  mov r1.yzw, vThreadGroupID.yyyy
  store_uav_typed u0.xyzw, r1.xyzw, r0.xxxx
endif 
ret 
// Approximately 284 instruction slots used
