seenat-deported-methods.azsl 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ShaderResourceGroupSemantic F1{FrequencyId = 1;};
  2. ShaderResourceGroup Srg1 : F1
  3. {
  4. StructuredBuffer<struct E { float seed; }> m_ext;
  5. };
  6. struct Vertex
  7. {
  8. float3 m_position : POSITION;
  9. };
  10. float AccessSeed()
  11. {
  12. return Srg1::m_ext[0].seed;
  13. }
  14. class Random
  15. {
  16. // early declaration to be callable in the body of Init (AZSL specificity)
  17. void Next(); // seenat *1
  18. // **
  19. float cur;
  20. // ***
  21. void Init()
  22. {
  23. cur = AccessSeed(); // seenat **1
  24. Next(); // seenat *2
  25. }
  26. };
  27. // deported definition *
  28. void Random::Next() // not a seenat. definition is not a reference (but there is a seenat of Random as part of the idexpression)
  29. {
  30. // call hereunder is a recursion; binding point analysis must diagnose an error.
  31. Init(); // seenat ***1
  32. cur += 1; // seenat **2
  33. }
  34. // VERTEX ENTRY
  35. Vertex MainVS(Vertex input)
  36. {
  37. Random r;
  38. r.Init(); // seenat ***2
  39. return input;
  40. }