//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer XeResolveConstants
// {
//
//   uint xe_resolve_edram_info;        // Offset:    0 Size:     4
//   uint xe_resolve_address_info;      // Offset:    4 Size:     4
//   uint xe_resolve_dest_info;         // Offset:    8 Size:     4
//   uint xe_resolve_dest_pitch;        // Offset:   12 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      ID      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- ------- -------------- ------
// xe_resolve_source                 texture   uint4         buf      T0             t0      1 
// xe_resolve_dest                       UAV   uint4         buf      U0             u0      1 
// XeResolveConstants                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][1], immediateIndexed, space=0
dcl_resource_buffer (uint,uint,uint,uint) T0[0:0], space=0
dcl_uav_typed_buffer (uint,uint,uint,uint) U0[0:0], space=0
dcl_input vThreadID.xy
dcl_temps 7
dcl_thread_group 8, 8, 1
ishl r0.xw, vThreadID.xxxx, l(1, 0, 0, 1)
ushr r1.x, CB0[0][0].y, l(7)
bfi r1.x, l(11), l(3), r1.x, l(0)
uge r1.x, r0.w, r1.x
if_nz r1.x
  ret 
endif 
ushr r1.xy, CB0[0][0].yyyy, l(5, 29, 0, 0)
mov r1.z, CB0[0][0].y
bfi r2.xy, l(5, 2, 0, 0), l(3, 3, 0, 0), r1.zxzz, l(0, 0, 0, 0)
mov r0.yz, vThreadID.yyyy
iadd r2.xy, r0.wzww, r2.xyxx
ubfe r2.zw, l(0, 0, 2, 12), l(0, 0, 10, 13), CB0[0][0].xxxx
and r3.xyzw, CB0[0][0].xxzx, l(1023, 4096, 0x01000000, 0x40000000)
uge r1.w, l(3), r1.y
if_nz r1.w
  mov r4.y, r1.y
else 
  ieq r1.w, r1.y, l(5)
  if_nz r1.w
    mov r4.y, l(2)
  else 
    mov r4.y, l(0)
  endif 
endif 
uge r1.yw, r2.zzzz, l(0, 2, 0, 1)
and r4.zw, r1.yyyw, l(0, 0, 1, 1)
ishl r2.xy, r2.xyxx, r4.zwzz
ushr r4.x, r4.y, l(1)
and r4.xy, r4.xyxx, l(1, 1, 0, 0)
iadd r2.xy, r2.xyxx, r4.xyxx
udiv r1.w, null, r2.x, l(80)
ushr r2.z, r2.y, l(4)
imad r3.x, r2.z, r3.x, r1.w
iadd r2.w, r2.w, r3.x
ineg r4.x, r1.w
ineg r4.y, r2.z
imad r2.xy, r4.xyxx, l(80, 16, 0, 0), r2.xyxx
if_nz r3.y
  uge r1.w, r2.x, l(40)
  movc r1.w, r1.w, l(-40), l(40)
  iadd r2.x, r1.w, r2.x
endif 
imad r1.w, r2.y, l(80), r2.x
imad r1.w, r2.w, l(1280), r1.w
ld r2.xyzw, r1.wwww, T0[0].xyzw
movc r1.y, r1.y, l(2), l(1)
iadd r1.y, r1.y, r1.w
ld r4.xyzw, r1.yyyy, T0[0].xyzw
if_nz r3.z
  ubfe r1.y, l(4), l(25), CB0[0][0].x
  switch r1.y
    case l(0)
    case l(1)
    and r5.xyzw, r2.xyzw, l(0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00)
    bfi r5.xyzw, l(8, 8, 8, 8), l(16, 16, 16, 16), r2.xyzw, r5.xyzw
    ubfe r6.xyzw, l(8, 8, 8, 8), l(16, 16, 16, 16), r2.xyzw
    iadd r2.xyzw, r5.xyzw, r6.xyzw
    and r5.xyzw, r4.xyzw, l(0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00)
    bfi r5.xyzw, l(8, 8, 8, 8), l(16, 16, 16, 16), r4.xyzw, r5.xyzw
    ubfe r6.xyzw, l(8, 8, 8, 8), l(16, 16, 16, 16), r4.xyzw
    iadd r4.xyzw, r5.xyzw, r6.xyzw
    break 
    case l(2)
    case l(3)
    case l(10)
    case l(12)
    and r5.xyzw, r2.xyzw, l(0xc00ffc00, 0xc00ffc00, 0xc00ffc00, 0xc00ffc00)
    bfi r5.xyzw, l(10, 10, 10, 10), l(20, 20, 20, 20), r2.xyzw, r5.xyzw
    ubfe r6.xyzw, l(10, 10, 10, 10), l(20, 20, 20, 20), r2.xyzw
    iadd r2.xyzw, r5.xyzw, r6.xyzw
    and r5.xyzw, r4.xyzw, l(0xc00ffc00, 0xc00ffc00, 0xc00ffc00, 0xc00ffc00)
    bfi r5.xyzw, l(10, 10, 10, 10), l(20, 20, 20, 20), r4.xyzw, r5.xyzw
    ubfe r6.xyzw, l(10, 10, 10, 10), l(20, 20, 20, 20), r4.xyzw
    iadd r4.xyzw, r5.xyzw, r6.xyzw
    break 
    default 
    break 
  endswitch 
  mov r5.yzw, r2.xxyz
else 
  mov r5.yzw, r2.xxyz
endif 
if_nz r3.w
  if_z r0.w
    mov r5.x, r5.z
    mov r2.z, r2.w
  else 
    mov r5.x, r5.y
    mov r2.z, r5.w
  endif 
  if_z vThreadID.y
    mov r2.xy, r2.zwzz
    mov r4.xy, r4.zwzz
  else 
    mov r2.xy, r5.xzxx
  endif 
else 
  mov r2.xyz, r5.yzwy
endif 
bfi r1.xyzw, l(2, 2, 2, 2), l(3, 3, 3, 3), r1.zxxz, l(0, 0, 0, 0)
iadd r0.xyzw, r0.xyzw, r1.xyzw
and r1.xyz, CB0[0][0].zwzz, l(7, 0x00003fff, 8, 0)
if_nz r1.z
  ubfe r3.xy, l(3, 14, 0, 0), l(4, 16, 0, 0), CB0[0][0].zwzz
  mov r1.w, r3.y
  iadd r1.zw, r1.wwwy, l(0, 0, 31, 31)
  ishr r5.xyzw, r0.zwzw, l(4, 5, 3, 3)
  ishr r3.y, r3.x, l(2)
  ushr r1.zw, r1.zzzw, l(0, 0, 4, 5)
  and r1.z, r1.z, l(2046)
  imad r1.z, r3.y, r1.z, r5.x
  imad r1.z, r1.z, r1.w, r5.y
  ishl r1.w, r0.z, l(10)
  and r1.w, r1.w, l(6144)
  bfi r1.w, l(3), l(8), r0.w, r1.w
  ishr r1.w, r1.w, l(6)
  iadd r3.y, r3.y, r5.z
  bfi r3.z, l(1), l(1), r3.y, l(0)
  iadd r3.z, r3.z, r5.w
  bfi r3.z, l(2), l(1), r3.z, l(0)
  bfi r3.y, l(1), l(0), r3.y, r3.z
  and r3.z, r1.w, l(112)
  bfi r5.xy, l(20, 20, 0, 0), l(10, 13, 0, 0), r1.zzzz, l(0, 0, 0, 0)
  imad r3.zw, r3.zzzz, l(0, 0, 2, 16), r5.xxxy
  bfi r1.zw, l(0, 0, 4, 4), l(0, 0, 0, 3), r1.wwww, r3.zzzw
  bfi r1.zw, l(0, 0, 2, 2), l(0, 0, 8, 11), r3.xxxx, r1.zzzw
  ubfe r3.x, l(3), l(6), r1.z
  and r3.z, r3.y, l(6)
  bfi r3.y, l(1), l(8), r3.y, l(0)
  imad r3.x, r3.x, l(32), r3.y
  imad r3.x, r3.z, l(4), r3.x
  bfi r1.zw, l(0, 0, 1, 1), l(0, 0, 4, 7), r0.zzzz, r1.zzzw
  bfi r1.w, l(9), l(3), r3.x, r1.w
  bfi r1.z, l(6), l(0), r1.z, r1.w
else 
  ishr r3.xyzw, r0.xyzw, l(5, 5, 2, 3)
  iadd r0.x, r1.y, l(31)
  ushr r0.x, r0.x, l(5)
  imad r0.x, r3.y, r0.x, r3.x
  ishl r1.yw, r0.zzzz, l(0, 4, 0, 7)
  and r1.yw, r1.yyyw, l(0, 224, 0, 2048)
  bfi r0.y, l(3), l(2), r0.w, r1.y
  ishl r1.y, r1.y, l(1)
  bfi r0.w, l(3), l(3), r0.w, r1.y
  and r0.w, r0.w, l(480)
  bfi r1.y, l(23), l(9), r0.x, r0.w
  bfi r1.y, l(4), l(0), r0.y, r1.y
  bfi r1.y, l(1), l(4), r0.z, r1.y
  ishl r3.xy, r0.wwww, l(3, 2, 0, 0)
  bfi r0.xw, l(23, 0, 0, 23), l(12, 0, 0, 11), r0.xxxx, r3.xxxy
  bfi r0.xy, l(4, 4, 0, 0), l(3, 2, 0, 0), r0.yyyy, r0.xwxx
  bfi r0.xy, l(1, 1, 0, 0), l(7, 6, 0, 0), r0.zzzz, r0.xyxx
  bfi r0.x, l(12), l(0), r1.w, r0.x
  and r0.y, r0.y, l(1792)
  iadd r0.x, r0.x, r0.y
  and r0.y, r3.z, l(2)
  iadd r0.y, r3.w, r0.y
  bfi r0.y, l(2), l(6), r0.y, l(0)
  iadd r0.x, r0.x, r0.y
  bfi r1.z, l(6), l(0), r1.y, r0.x
endif 
ushr r0.x, r1.z, l(2)
ieq r0.yzw, r1.xxxx, l(0, 1, 2, 3)
or r0.yz, r0.zzwz, r0.yyzy
if_nz r0.y
  ishl r1.xyzw, r2.xyzw, l(8, 8, 8, 8)
  and r1.xyzw, r1.xyzw, l(0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00)
  ushr r3.xyzw, r2.xyzw, l(8, 8, 8, 8)
  and r3.xyzw, r3.xyzw, l(0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff)
  iadd r2.xyzw, r1.xyzw, r3.xyzw
endif 
if_nz r0.z
  ushr r1.xyzw, r2.xyzw, l(16, 16, 16, 16)
  bfi r2.xyzw, l(16, 16, 16, 16), l(16, 16, 16, 16), r2.xyzw, r1.xyzw
endif 
store_uav_typed U0[0].xyzw, r0.xxxx, r2.xyzw
iadd r0.w, r0.x, l(1)
if_nz r0.y
  ishl r1.xyzw, r4.xyzw, l(8, 8, 8, 8)
  and r1.xyzw, r1.xyzw, l(0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00)
  ushr r2.xyzw, r4.xyzw, l(8, 8, 8, 8)
  and r2.xyzw, r2.xyzw, l(0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff)
  iadd r4.xyzw, r1.xyzw, r2.xyzw
endif 
if_nz r0.z
  ushr r1.xyzw, r4.xyzw, l(16, 16, 16, 16)
  bfi r4.xyzw, l(16, 16, 16, 16), l(16, 16, 16, 16), r4.xyzw, r1.xyzw
endif 
store_uav_typed U0[0].xyzw, r0.wwww, r4.xyzw
ret 
// Approximately 191 instruction slots used
