DebugPhisIfElse.hlsl 789 B

123456789101112131415161718192021222324252627
  1. // RUN: %dxc -EFlowControlPS -Tps_6_0 %s -Od | %opt -S -dxil-annotate-with-virtual-regs -hlsl-dxil-debug-instrumentation | %FileCheck %s
  2. // Ensure that the pass added a block at the end of this if/else:
  3. // CHECK: br label %PIXDebug
  4. // CHECK: br label %PIXDebug
  5. // Check that block 0 emits some debug info and returns where we expect:
  6. // CHECK: PIXDebug
  7. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  8. // CHECK: br label
  9. // Check that block 1 emits some debug info and returns where we expect:
  10. // CHECK: PIXDebug
  11. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  12. // CHECK: br label
  13. float4 FlowControlPS(in uint value : value ) : SV_Target
  14. {
  15. float4 ret = float4(0, 0, 0, 0);
  16. if (value > 1) {
  17. ret = float4(0, 0, 0, 2);
  18. } else {
  19. ret = float4(0, 0, 0, 1);
  20. }
  21. return ret;
  22. }