//may check for lights in doors clipping
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.11 on Mon Nov 26 07:38:27 2018
//
//
// Buffer Definitions:
//
// cbuffer TiledDeferredCSParams_CB
// {
//
//   struct tTiledDeferredCS
//   {
//
//       row_major float4x4 mMainSceneInvProj;// Offset:    0
//       row_major float4x4 mMainSceneProj;// Offset:   64
//       row_major float4x4 mMainSceneView;// Offset:  128
//       row_major float4x4 mMainSceneInvTransInvView;// Offset:  192
//       row_major float4x4 mMainSceneInvViewProjThread;// Offset:  256
//       row_major float4x4 mMainSceneViewProj;// Offset:  320
//       float4 mScreenResClipDistances;// Offset:  384
//       float4 mAOStrengthParams;      // Offset:  400
//       float4 mCameraPosition;        // Offset:  416
//       float4 mCameraParameters[2];   // Offset:  432
//       float4 mAnisoParams;           // Offset:  464
//       float4 mLightShadowParams;     // Offset:  480
//       float4 mShadowMapTexelSize;    // Offset:  496
//       float4 mViewportInfo;          // Offset:  512
//       float4 mClusteredLightingParams[4];// Offset:  528
//       float4 mRimLightParams[2];     // Offset:  592
//       float4 mTranslucencyLightingDebugParams;// Offset:  624
//       float4 mLightComponentToggler[4];// Offset:  640
//       float4 mLightingExperiment[3]; // Offset:  704
//       float4 mLightingModelTestParams[5];// Offset:  752
//       float2 mDirectLightingExtraParams;// Offset:  832
//       float2 mFullScreenRenderTargetDimensions;// Offset:  840
//       float mEyeLightWrapPercent;    // Offset:  848
//       int mEnableSssOnPointLights;   // Offset:  852
//       int mEnableTranslucencyLighting;// Offset:  856
//       int mDebugMaxLightListEntries; // Offset:  860
//
//   } TiledDeferredCSParams;           // Offset:    0 Size:   864
//
// }
//
// Resource bind info for ClusterGridLightCounts
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for ClusterSumsScratchSpace
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for ClusterGridOffsets
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ClusterGridLightCounts            texture  struct         r/o    0        1
// ClusterSumsScratchSpace               UAV  struct         r/w    0        1
// ClusterGridOffsets                    UAV  struct         r/w    1        1
// TiledDeferredCSParams_CB          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 cb1[36], immediateIndexed
dcl_resource_structured t0, 4
dcl_uav_structured u0, 4
dcl_uav_structured u1, 4
dcl_input vThreadGroupID.x
dcl_input vThreadIDInGroup.x
dcl_input vThreadID.x
dcl_temps 2
dcl_tgsm_structured g0, 4, 256
dcl_thread_group 256, 1, 1
ftou r0.x, cb1[35].z
uge r0.x, vThreadID.x, r0.x
if_z r0.x
  ftou r0.yz, cb1[35].xxyx
  imul null, r0.y, r0.z, r0.y
  ishl r0.z, r0.y, l(4)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.w, vThreadID.x, l(0), t0.xxxx
  iadd r1.x, r0.z, vThreadID.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r1.x, l(0), t0.xxxx
  iadd r0.w, r0.w, r1.x
  ishl r0.z, r0.z, l(1)
  iadd r0.z, r0.z, vThreadID.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.z, r0.z, l(0), t0.xxxx
  iadd r0.z, r0.z, r0.w
  imad r0.y, r0.y, l(48), vThreadID.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.y, r0.y, l(0), t0.xxxx
  iadd r0.y, r0.y, r0.z
  store_structured g0.x, vThreadIDInGroup.x, l(0), r0.y
else
  mov r0.y, l(0)
endif
sync_g_t
mov r0.z, l(1)
loop
  uge r0.w, r0.z, l(256)
  breakc_nz r0.w
  uge r0.w, vThreadIDInGroup.x, r0.z
  if_nz r0.w
    iadd r1.x, -r0.z, vThreadIDInGroup.x
    ld_structured r1.x, r1.x, l(0), g0.xxxx
    ld_structured r1.y, vThreadIDInGroup.x, l(0), g0.xxxx
    iadd r1.x, r1.y, r1.x
  else
    mov r1.x, l(0)
  endif
  sync_g_t
  if_nz r0.w
    store_structured g0.x, vThreadIDInGroup.x, l(0), r1.x
  endif
  sync_g_t
  ishl r0.z, r0.z, l(1)
endloop
if_nz r0.x
  ret
endif
ld_structured r0.x, vThreadIDInGroup.x, l(0), g0.xxxx
iadd r0.x, -r0.y, r0.x
store_structured u1.x, vThreadID.x, l(0), r0.x
if_z vThreadIDInGroup.x
  ld_structured r0.x, l(255), l(0), g0.xxxx
  store_structured u0.x, vThreadGroupID.x, l(0), r0.x
endif
ret
// Approximately 53 instruction slots used
