//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer XeTextureTileConstants
// {
//
//   uint xe_texture_tile_guest_base;   // Offset:    0 Size:     4
//   uint xe_texture_tile_endian_format_guest_pitch;// Offset:    4 Size:     4
//   uint xe_texture_tile_offset;       // Offset:    8 Size:     4
//   uint xe_texture_tile_size;         // Offset:   12 Size:     4
//   uint xe_texture_tile_host_base;    // Offset:   16 Size:     4
//   uint xe_texture_tile_host_pitch;   // Offset:   20 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      ID      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- ------- -------------- ------
// xe_texture_tile_source            texture    byte         r/o      T0             t0      1 
// xe_texture_tile_dest                  UAV    uint         buf      U0             u0      1 
// XeTextureTileConstants            cbuffer      NA          NA     CB0            cb0      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_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[0:0][2], immediateIndexed, space=0
dcl_resource_raw T0[0:0], space=0
dcl_uav_typed_buffer (uint,uint,uint,uint) U0[0:0], space=0
dcl_input vThreadID.xy
dcl_temps 9
dcl_thread_group 8, 32, 1
ushr r0.y, CB0[0][0].w, l(16)
mov r0.x, CB0[0][0].w
and r0.xy, r0.xyxx, l(0x0000ffff, 0x0000ffff, 0, 0)
ishl r1.x, vThreadID.x, l(2)
mov r1.y, vThreadID.y
uge r0.yz, r1.xxyx, r0.xxyx
or r0.y, r0.z, r0.y
if_nz r0.y
  ret 
endif 
imad r0.y, vThreadID.y, CB0[0][1].y, CB0[0][1].x
ishl r0.z, r1.x, l(2)
iadd r0.y, r0.z, r0.y
ld_raw r2.xyzw, r0.y, T0[0].xyzw
ubfe r0.y, l(6), l(3), CB0[0][0].y
ieq r0.z, r0.y, l(3)
if_nz r0.z
  ubfe r3.xyzw, l(5, 5, 5, 5), l(3, 3, 3, 3), r2.xyzw
  ushr r4.xyzw, r2.xyzw, l(6, 6, 6, 6)
  and r4.xyzw, r4.xyzw, l(992, 992, 992, 992)
  iadd r3.xyzw, r3.xyzw, r4.xyzw
  ushr r4.xyzw, r2.xyzw, l(9, 9, 9, 9)
  and r4.xyzw, r4.xyzw, l(0x00007c00, 0x00007c00, 0x00007c00, 0x00007c00)
  iadd r3.xyzw, r3.xyzw, r4.xyzw
  ushr r4.xyzw, r2.xyzw, l(16, 16, 16, 16)
  bfi r2.xyzw, l(15, 15, 15, 15), l(0, 0, 0, 0), r3.xyzw, r4.xyzw
else 
  ieq r0.y, r0.y, l(15)
  if_nz r0.y
    ubfe r3.xyzw, l(4, 4, 4, 4), l(4, 4, 4, 4), r2.xyzw
    ushr r4.xyzw, r2.xyzw, l(8, 8, 8, 8)
    and r4.xyzw, r4.xyzw, l(240, 240, 240, 240)
    iadd r3.xyzw, r3.xyzw, r4.xyzw
    ushr r4.xyzw, r2.xyzw, l(12, 12, 12, 12)
    and r4.xyzw, r4.xyzw, l(3840, 3840, 3840, 3840)
    iadd r3.xyzw, r3.xyzw, r4.xyzw
    ushr r4.xyzw, r2.xyzw, l(16, 16, 16, 16)
    bfi r2.xyzw, l(12, 12, 12, 12), l(0, 0, 0, 0), r3.xyzw, r4.xyzw
  endif 
endif 
ushr r3.xyz, CB0[0][0].yzyy, l(1, 16, 9, 0)
xor r0.y, r3.x, CB0[0][0].y
and r0.y, r0.y, l(1)
if_nz r0.y
  bfi r4.xyzw, l(8, 8, 8, 8), l(8, 8, 8, 8), r2.xyzw, l(0, 0, 0, 0)
  ubfe r5.xyzw, l(8, 8, 8, 8), l(8, 8, 8, 8), r2.xyzw
  iadd r2.xyzw, r4.xyzw, r5.xyzw
endif 
mov r3.w, CB0[0][0].z
and r0.yz, r3.wwyw, l(0, 0x0000ffff, 0x0000ffff, 0)
iadd r0.yz, r1.xxyx, r0.yyzy
iadd r1.xyzw, r0.yyyy, l(0, 1, 2, 3)
ushr r4.xyzw, r1.xyzw, l(5, 5, 5, 5)
ushr r0.yw, r0.zzzz, l(0, 5, 0, 2)
iadd r3.x, r3.z, l(31)
ushr r3.x, r3.x, l(5)
imad r3.xyzw, r0.yyyy, r3.xxxx, r4.xyzw
ishl r4.xy, r0.zzzz, l(3, 7, 0, 0)
and r4.xy, r4.xyxx, l(112, 2048, 0, 0)
bfi r5.xyzw, l(3, 3, 3, 3), l(1, 1, 1, 1), r1.xyzw, r4.xxxx
ishl r0.y, r4.x, l(1)
bfi r6.xyzw, l(3, 3, 3, 3), l(2, 2, 2, 2), r1.xyzw, r0.yyyy
and r6.xyzw, r6.xyzw, l(224, 224, 224, 224)
bfi r7.xyzw, l(24, 24, 24, 24), l(8, 8, 8, 8), r3.xyzw, r6.xyzw
bfi r7.xyzw, l(4, 4, 4, 4), l(0, 0, 0, 0), r5.xyzw, r7.xyzw
bfi r7.xyzw, l(1, 1, 1, 1), l(4, 4, 4, 4), r0.zzzz, r7.xyzw
ishl r8.xyzw, r6.xyzw, l(3, 3, 3, 3)
bfi r8.xyzw, l(24, 24, 24, 24), l(11, 11, 11, 11), r3.xyzw, r8.xyzw
bfi r8.xyzw, l(4, 4, 4, 4), l(3, 3, 3, 3), r5.xyzw, r8.xyzw
bfi r8.xyzw, l(1, 1, 1, 1), l(7, 7, 7, 7), r0.zzzz, r8.xyzw
bfi r4.xyzw, l(12, 12, 12, 12), l(0, 0, 0, 0), r4.yyyy, r8.xyzw
ishl r6.xyzw, r6.xyzw, l(2, 2, 2, 2)
bfi r3.xyzw, l(24, 24, 24, 24), l(10, 10, 10, 10), r3.xyzw, r6.xyzw
bfi r3.xyzw, l(4, 4, 4, 4), l(2, 2, 2, 2), r5.xyzw, r3.xyzw
bfi r3.xyzw, l(1, 1, 1, 1), l(6, 6, 6, 6), r0.zzzz, r3.xyzw
and r3.xyzw, r3.xyzw, l(1792, 1792, 1792, 1792)
iadd r3.xyzw, r4.xyzw, r3.xyzw
ushr r1.xyzw, r1.xyzw, l(3, 3, 3, 3)
and r0.y, r0.w, l(2)
iadd r1.xyzw, r0.yyyy, r1.xyzw
bfi r1.xyzw, l(2, 2, 2, 2), l(6, 6, 6, 6), r1.xyzw, l(0, 0, 0, 0)
iadd r1.xyzw, r3.xyzw, r1.xyzw
bfi r1.xyzw, l(6, 6, 6, 6), l(0, 0, 0, 0), r7.xyzw, r1.xyzw
iadd r1.xyzw, r1.xyzw, CB0[0][0].xxxx
ushr r1.xyzw, r1.xyzw, l(1, 1, 1, 1)
store_uav_typed U0[0].xyzw, r1.xxxx, r2.xxxx
imad r0.yzw, vThreadID.xxxx, l(0, 4, 4, 4), l(0, 1, 2, 3)
ult r0.xyz, r0.yzwy, r0.xxxx
if_nz r0.x
  store_uav_typed U0[0].xyzw, r1.yyyy, r2.yyyy
  if_nz r0.y
    store_uav_typed U0[0].xyzw, r1.zzzz, r2.zzzz
    if_nz r0.z
      store_uav_typed U0[0].xyzw, r1.wwww, r2.wwww
    endif 
  endif 
endif 
ret 
// Approximately 98 instruction slots used
