DynamicSamplerAccessTracking.hlsl 1.0 KB

1234567891011121314151617181920212223242526
  1. // RUN: %dxc -EMain -Tps_6_6 %s | %opt -S -hlsl-dxil-pix-shader-access-instrumentation,config=S0:1:1i1;.256;512;1024. | %FileCheck %s
  2. static sampler sampler0 = SamplerDescriptorHeap[0];
  3. static sampler sampler3 = SamplerDescriptorHeap[3];
  4. Texture2D tx : register(t2);
  5. float4 Main() : SV_Target
  6. {
  7. float4 a = tx.Sample(sampler0, float2(0,0));
  8. float4 b = tx.Sample(sampler3, float2(0,0));
  9. return a + b;
  10. }
  11. // check it's 6.6:
  12. // CHECK: call %dx.types.Handle @dx.op.createHandleFromBinding
  13. // The large integers are encoded flags for the ResourceAccessStyle (an enumerated type in lib\DxilPIXPasses\DxilShaderAccessTracking.cpp) for this access
  14. // Check we wrote sampler data to the PIX UAV. We told the pass to output starting at offset 512.
  15. // Add 8 to skip the "out of bounds" record. Add 4 to point to the "read" field within the next entry = 524
  16. // CHECK: call void @dx.op.bufferStore.i32(
  17. // CHECK:i32 524, i32 undef, i32 16777216
  18. // twice: 512 + 8 + 8*3+4 = 548
  19. // CHECK: call void @dx.op.bufferStore.i32(
  20. // CHECK:i32 548, i32 undef, i32 16777216