pixelCounter.hlsl 825 B

1234567891011121314151617181920
  1. // RUN: %dxc -Emain -Tps_6_0 %s | %opt -S -hlsl-dxil-add-pixel-hit-instrmentation,rt-width=16,num-pixels=64 | %FileCheck %s
  2. // Check that the input semantic was read correctly:
  3. // CHECK: %XPos = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0, i32 undef)
  4. // CHECK: %YPos = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1, i32 undef)
  5. // The cast-to-int:
  6. // CHECK: %XIndex = fptoui float %XPos to i32
  7. // CHECK: %YIndex = fptoui float %YPos to i32
  8. // Calculation of offset:
  9. // CHECK: = mul i32 %YIndex, 16
  10. // CHECK: = add i32 %XIndex,
  11. // Check the write to the UAV was emitted:
  12. // CHECK: %UAVIncResult = call i32 @dx.op.atomicBinOp.i32(i32 78, %dx.types.Handle %PIX_CountUAV_Handle, i32 0, i32 %ByteIndex, i32 undef, i32 undef, i32 1)
  13. float4 main(float4 pos : SV_Position) : SV_Target {
  14. return pos;
  15. }