//blod splatter no fix here
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.11 on Sun Nov 18 17:40:23 2018
//
//
// Buffer Definitions:
//
// cbuffer TiledCountBuffer_CB
// {
//
//   struct tLightCountData
//   {
//
//       uint mNumLights;               // Offset:    0
//       uint mNumXTiles;               // Offset:    4
//       uint mNumYTiles;               // Offset:    8
//       uint mSHScalesReflectionFlag;  // Offset:   12
//
//   } TiledCountBuffer;                // Offset:    0 Size:    16
//
// }
//
// Resource bind info for DecalPerTileBitField
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for OutputDecalsPerTile
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for OutputNumDecalsPerTile
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for output_append_buffer_decal
// {
//
//   struct tTileLocation
//   {
//
//       uint x_y_packed;               // Offset:    0
//
//   } $Element;                        // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DecalPerTileBitField              texture  struct         r/o    0        1
// OutputDecalsPerTile                   UAV  struct         r/w    0        1
// OutputNumDecalsPerTile                UAV  struct         r/w    1        1
// output_append_buffer_decal            UAV  struct      append    2        1
// TiledCountBuffer_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[1], immediateIndexed
dcl_resource_structured t0, 4
dcl_uav_structured u0, 4
dcl_uav_structured u1, 4
dcl_uav_structured u2, 4
dcl_input vThreadID.x
dcl_temps 3
dcl_thread_group 64, 1, 1
uge r0.x, vThreadID.x, cb1[0].w
if_nz r0.x
  ret
endif
iadd r0.x, cb1[0].x, l(31)
ushr r0.x, r0.x, l(5)
umin r0.x, r0.x, l(16)
ishl r0.yz, vThreadID.xxxx, l(0, 9, 8, 0)
ushr r0.y, r0.y, l(5)
mov r1.xy, l(0,0,0,0)
loop
  uge r0.w, r1.y, r0.x
  breakc_nz r0.w
  iadd r0.w, r0.y, r1.y
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.w, r0.w, l(0), t0.xxxx
  if_nz r0.w
    ishl r1.z, r1.y, l(5)
    mov r2.x, r1.x
    mov r2.y, l(0)
    loop
      uge r1.w, r2.y, l(32)
      breakc_nz r1.w
      ishl r1.w, l(1), r2.y
      and r1.w, r0.w, r1.w
      if_nz r1.w
        iadd r1.w, r0.z, r2.x
        or r2.z, r1.z, r2.y
        store_structured u0.x, r1.w, l(0), r2.z
        iadd r2.x, r2.x, l(1)
      endif
      iadd r2.y, r2.y, l(1)
    endloop
    mov r1.x, r2.x

  endif
  iadd r1.y, r1.y, l(1)
endloop
store_structured u1.x, vThreadID.x, l(0), r1.x
if_nz r1.x
  udiv r0.x, r1.x, vThreadID.x, cb1[0].y
  bfi r0.x, l(16), l(16), r1.x, r0.x
  imm_atomic_alloc r1.x, u2
  store_structured u2.x, r1.x, l(0), r0.x
endif
ret
// Approximately 44 instruction slots used
