Panda3D
pipeline.I
1 // Filename: pipeline.I
2 // Created by: drose (21Feb02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: Pipeline::get_render_pipeline
18 // Access: Public, Static
19 // Description: Returns a pointer to the global render pipeline.
20 ////////////////////////////////////////////////////////////////////
21 INLINE Pipeline *Pipeline::
23  if (_render_pipeline == (Pipeline *)NULL) {
24  make_render_pipeline();
25  }
26  return _render_pipeline;
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: Pipeline::set_min_stages
31 // Access: Public
32 // Description: Ensures that at least the indicated number of stages
33 // are in the pipeline.
34 ////////////////////////////////////////////////////////////////////
35 INLINE void Pipeline::
36 set_min_stages(int min_stages) {
37  set_num_stages(max(min_stages, get_num_stages()));
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: Pipeline::get_num_stages
42 // Access: Public
43 // Description: Returns the number of stages required for the
44 // pipeline.
45 ////////////////////////////////////////////////////////////////////
46 INLINE int Pipeline::
47 get_num_stages() const {
48  return _num_stages;
49 }
50 
51 #ifdef THREADED_PIPELINE
52 ////////////////////////////////////////////////////////////////////
53 // Function: Pipeline::get_num_cyclers
54 // Access: Public
55 // Description: Returns the number of PipelineCyclers in the universe
56 // that reference this Pipeline object.
57 ////////////////////////////////////////////////////////////////////
58 INLINE int Pipeline::
59 get_num_cyclers() const {
60  ReMutexHolder holder(_lock);
61  return _num_cyclers;
62 }
63 #endif // THREADED_PIPELINE
64 
65 #ifdef THREADED_PIPELINE
66 ////////////////////////////////////////////////////////////////////
67 // Function: Pipeline::get_num_dirty_cyclers
68 // Access: Public
69 // Description: Returns the number of PipelineCyclers in the universe
70 // that reference this Pipeline object and are currently
71 // marked "dirty"; that is, there is a difference in
72 // pointer value between some of their stages.
73 ////////////////////////////////////////////////////////////////////
74 INLINE int Pipeline::
75 get_num_dirty_cyclers() const {
76  ReMutexHolder holder(_lock);
77  return _num_dirty_cyclers;
78 }
79 #endif // THREADED_PIPELINE
80 
void set_num_stages(int num_stages)
Specifies the number of stages required for the pipeline.
Definition: pipeline.cxx:214
Similar to MutexHolder, but for a reentrant mutex.
Definition: reMutexHolder.h:27
static Pipeline * get_render_pipeline()
Returns a pointer to the global render pipeline.
Definition: pipeline.I:22
This class manages a staged pipeline of data, for instance the render pipeline, so that each stage of...
Definition: pipeline.h:41
int get_num_stages() const
Returns the number of stages required for the pipeline.
Definition: pipeline.I:47
void set_min_stages(int min_stages)
Ensures that at least the indicated number of stages are in the pipeline.
Definition: pipeline.I:36