raw_buf2.hlsl 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. // RUN: %dxilver 1.2 | %dxc -E main -T ps_6_2 %s | FileCheck %s
  2. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf1_texture_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 1, i32 4)
  3. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf1_texture_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 3, i32 4)
  4. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf1_texture_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 7, i32 4)
  5. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf1_texture_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 15, i32 4)
  6. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf2_UAV_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 1, i32 4)
  7. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf2_UAV_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 3, i32 4)
  8. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf2_UAV_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 7, i32 4)
  9. // CHECK: call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %buf2_UAV_rawbuf, i32 %{{[0-9]+}}, i32 undef, i8 15, i32 4)
  10. // CHECK: uitofp
  11. ByteAddressBuffer buf1;
  12. RWByteAddressBuffer buf2;
  13. float4 main(uint idx1 : IDX1, uint idx2 : IDX2) : SV_Target {
  14. uint status;
  15. float4 r = float4(0,0,0,0);
  16. r.x += buf1.Load(idx1);
  17. r.xy += buf1.Load2(idx1, status);
  18. r.xyz += buf1.Load3(idx1);
  19. r.xyzw += buf1.Load4(idx1, status);
  20. r.x += buf2.Load(idx2, status);
  21. r.xy += buf2.Load2(idx2);
  22. r.xyz += buf2.Load3(idx2, status);
  23. r.xyzw += buf2.Load4(idx2);
  24. return r;
  25. }