Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sign 1.4KB

12345678910111213141516171819202122232425262728293031323334
  1. ((function sign
  2. (signature int
  3. (parameters
  4. (declare (in) int x))
  5. ((return (expression int / (var_ref x) (expression int abs (var_ref x))))))
  6. (signature ivec2
  7. (parameters
  8. (declare (in) ivec2 x))
  9. ((declare () ivec2 t)
  10. (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))
  11. (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))
  12. (return (var_ref t))))
  13. (signature ivec3
  14. (parameters
  15. (declare (in) ivec3 x))
  16. ((declare () ivec3 t)
  17. (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))
  18. (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))
  19. (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))
  20. (return (var_ref t))))
  21. (signature ivec4
  22. (parameters
  23. (declare (in) ivec4 x))
  24. ((declare () ivec4 t)
  25. (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))
  26. (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))
  27. (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))
  28. (assign (constant bool (1)) (swiz w (var_ref t)) (expression int sign (swiz w (var_ref x))))
  29. (return (var_ref t))))
  30. ))