recursive2.hlsl 337 B

1234567891011121314151617181920212223
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // CHECK: error: recursive functions not allowed
  3. struct M {
  4. float m;
  5. };
  6. void test_inout(inout M m, float a)
  7. {
  8. if (a.x > 1)
  9. test_inout(m, a-1);
  10. m.m = abs(m.m+a);
  11. }
  12. float4 main(float a : A, float b:B) : SV_TARGET
  13. {
  14. M m;
  15. m.m = b;
  16. test_inout(m, a);
  17. return m.m;
  18. }