Panda3D
pipeline.I
Go to the documentation of this file.
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 /**
15  * Returns a pointer to the global render pipeline.
16  */
17 INLINE Pipeline *Pipeline::
19  if (_render_pipeline == nullptr) {
20  make_render_pipeline();
21  }
22  return _render_pipeline;
23 }
24 
25 /**
26  * Ensures that at least the indicated number of stages are in the pipeline.
27  */
28 INLINE void Pipeline::
29 set_min_stages(int min_stages) {
30  set_num_stages(std::max(min_stages, get_num_stages()));
31 }
32 
33 /**
34  * Returns the number of stages required for the pipeline.
35  */
36 INLINE int Pipeline::
37 get_num_stages() const {
38  return _num_stages;
39 }
40 
41 #ifdef THREADED_PIPELINE
42 /**
43  * Returns the number of PipelineCyclers in the universe that reference this
44  * Pipeline object.
45  */
46 INLINE int Pipeline::
47 get_num_cyclers() const {
48  MutexHolder holder(_lock);
49  return _num_cyclers;
50 }
51 #endif // THREADED_PIPELINE
52 
53 #ifdef THREADED_PIPELINE
54 /**
55  * Returns the number of PipelineCyclers in the universe that reference this
56  * Pipeline object and are currently marked "dirty"; that is, there is a
57  * difference in pointer value between some of their stages.
58  */
59 INLINE int Pipeline::
60 get_num_dirty_cyclers() const {
61  MutexHolder holder(_lock);
62  return _num_dirty_cyclers;
63 }
64 #endif // THREADED_PIPELINE
void set_num_stages(int num_stages)
Specifies the number of stages required for the pipeline.
Definition: pipeline.cxx:283
A lightweight C++ object whose constructor calls acquire() and whose destructor calls release() on a ...
Definition: mutexHolder.h:25
static Pipeline * get_render_pipeline()
Returns a pointer to the global render pipeline.
Definition: pipeline.I:18
This class manages a staged pipeline of data, for instance the render pipeline, so that each stage of...
Definition: pipeline.h:38
int get_num_stages() const
Returns the number of stages required for the pipeline.
Definition: pipeline.I:37
void set_min_stages(int min_stages)
Ensures that at least the indicated number of stages are in the pipeline.
Definition: pipeline.I:29