loop3.hlsl 403 B

12345678910111213141516171819202122232425
  1. // RUN: %dxc -E main -O2 -T ps_6_0 %s | FileCheck %s
  2. // CHECK: !"llvm.loop.unroll.disable"
  3. float main(float2 a : A, int3 b : B) : SV_Target
  4. {
  5. float s = 0;
  6. [loop]
  7. for(int i = 0; i < b.x; i++) {
  8. [branch]
  9. if (b.z == 9)
  10. break;
  11. [allow_uav_condition]
  12. for(int j = 0; j <= 16; j++)
  13. {
  14. [branch]
  15. if (b.z == 16)
  16. break;
  17. s += a.x;
  18. }
  19. }
  20. return s;
  21. }