seenat-functions.azsl 880 B

12345678910111213141516171819202122232425262728293031323334353637
  1. float func(); // the function declared. (will become a ref)
  2. float4 psmain() : SV_TARGET0
  3. {
  4. float f = func(); // ref 2
  5. return float4(f, 0, 0, 1);
  6. }
  7. float func() // function defined. (not a ref)
  8. {
  9. return 1.0;
  10. }
  11. float func(); // ref 3. re-re-declared but should be innocent.
  12. class interferer
  13. {
  14. float func() { return 2.0; } // same local name but different symbol family
  15. };
  16. interferer getinterferer() { interferer i; return i; }
  17. float4 untint(float4 c)
  18. {
  19. typeof(func()) f = 0.0; // ref 4
  20. switch (func()) // ref 5
  21. {
  22. case 1.0:
  23. f = func(); // ref 6
  24. break;
  25. }
  26. interferer i;
  27. i.func(); // nope
  28. getinterferer().func(); // still nope
  29. return float4(func(), f, 0, 1); // ref 7
  30. }
  31. // WARNING: be careful in these files, any change will disrupt line and column numbers as checked by the seenat.py test