pipeline.I 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file pipeline.I
  10. * @author drose
  11. * @date 2002-02-21
  12. */
  13. /**
  14. * Returns a pointer to the global render pipeline.
  15. */
  16. INLINE Pipeline *Pipeline::
  17. get_render_pipeline() {
  18. if (_render_pipeline == nullptr) {
  19. make_render_pipeline();
  20. }
  21. return _render_pipeline;
  22. }
  23. /**
  24. * Ensures that at least the indicated number of stages are in the pipeline.
  25. */
  26. INLINE void Pipeline::
  27. set_min_stages(int min_stages) {
  28. set_num_stages(std::max(min_stages, get_num_stages()));
  29. }
  30. /**
  31. * Returns the number of stages required for the pipeline.
  32. */
  33. INLINE int Pipeline::
  34. get_num_stages() const {
  35. return _num_stages;
  36. }
  37. #ifdef THREADED_PIPELINE
  38. /**
  39. * Returns the number of PipelineCyclers in the universe that reference this
  40. * Pipeline object.
  41. */
  42. INLINE int Pipeline::
  43. get_num_cyclers() const {
  44. MutexHolder holder(_lock);
  45. return _num_cyclers;
  46. }
  47. #endif // THREADED_PIPELINE
  48. #ifdef THREADED_PIPELINE
  49. /**
  50. * Returns the number of PipelineCyclers in the universe that reference this
  51. * Pipeline object and are currently marked "dirty"; that is, there is a
  52. * difference in pointer value between some of their stages.
  53. */
  54. INLINE int Pipeline::
  55. get_num_dirty_cyclers() const {
  56. MutexHolder holder(_lock);
  57. return _num_dirty_cyclers;
  58. }
  59. #endif // THREADED_PIPELINE