DebugPhisFor.hlsl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // RUN: %dxc -EForLoopPS -Tps_6_0 %s -Od | %opt -S -dxil-annotate-with-virtual-regs -hlsl-dxil-debug-instrumentation | %FileCheck %s
  2. // Ensure that the pass added at the begining of the for body:
  3. // CHECK: br label %PIXDebug
  4. // CHECK: br label %PIXDebug
  5. // CHECK: br label %PIXDebug
  6. // Followed by lots of new pix debug blocks:
  7. // CHECK: PIXDebug
  8. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  9. // CHECK: br label
  10. // CHECK: PIXDebug
  11. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  12. // CHECK: br label
  13. // CHECK: PIXDebug
  14. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  15. // CHECK: br label
  16. // CHECK: PIXDebug
  17. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  18. // CHECK: br label
  19. // CHECK: PIXDebug
  20. // CHECK: call i32 @dx.op.atomicBinOp.i32(i32 78
  21. // CHECK: br label
  22. struct VS_OUTPUT_ENV {
  23. float4 Pos : SV_Position;
  24. float2 Tex : TEXCOORD0;
  25. };
  26. uint i32;
  27. float4 ForLoopPS(VS_OUTPUT_ENV input) : SV_Target {
  28. float4 ret = float4(0, 0, 0, 0);
  29. for (uint i = 0; i < abs(input.Tex.x * 200); ++i) {
  30. ret.x += (float)i32;
  31. if (i + i32 == 0) {
  32. break;
  33. }
  34. ret.y += (float)i32;
  35. if (i + i32 == 1) {
  36. continue;
  37. }
  38. ret.z += (float)i32;
  39. if (i + i32 == 2) {
  40. break;
  41. }
  42. ret.w += (float)i32;
  43. if (i + i32 == 3) {
  44. continue;
  45. }
  46. }
  47. return ret;
  48. }