DynamicResourceAccessTracking.hlsl 1.2 KB

1234567891011121314151617181920212223242526
  1. // RUN: %dxc -EMain -Tcs_6_6 %s | %opt -S -hlsl-dxil-pix-shader-access-instrumentation,config=.256;512;1024. | %FileCheck %s
  2. static RWByteAddressBuffer DynamicBuffer = ResourceDescriptorHeap[1];
  3. [numthreads(1, 1, 1)]
  4. void Main()
  5. {
  6. uint val = DynamicBuffer.Load(0u);
  7. DynamicBuffer.Store(0u, val);
  8. }
  9. // check it's 6.6:
  10. // CHECK: call %dx.types.Handle @dx.op.createHandleFromBinding
  11. // Check we wrote to the PIX UAV:
  12. // CHECK: call void @dx.op.bufferStore.i32
  13. // Offset for buffer Load should be 256 + 8 (skip out-of-bounds record) + 8 (it's the 1th resource) + 4 (offset to the "read" field) = 276
  14. // The large integer is encoded flags for the ResourceAccessStyle (an enumerated type in lib\DxilPIXPasses\DxilShaderAccessTracking.cpp) for this access
  15. // CHECK:i32 276, i32 undef, i32 1375731712
  16. // CHECK:rawBufferLoad
  17. // Offset for buffer Store should be 256 + 8 (skip out-of-bounds record) + 8 (it's the 1th resource) + 0 (offset to the "write" field) = 272
  18. // The large integer is encoded flags for the ResourceAccessStyle (an enumerated type in lib\DxilPIXPasses\DxilShaderAccessTracking.cpp) for this access
  19. // CHECK:i32 272, i32 undef, i32 1392508928
  20. // CHECK:rawBufferStore