15 #ifndef PIPELINECYCLER_H
16 #define PIPELINECYCLER_H
18 #include "pandabase.h"
19 #include "pipelineCyclerBase.h"
20 #include "cyclerHolder.h"
53 template<
class CycleDataType>
61 INLINE
const CycleDataType *
read(
Thread *current_thread)
const;
62 INLINE CycleDataType *
write(
Thread *current_thread);
64 INLINE CycleDataType *
elevate_read(
const CycleDataType *pointer,
Thread *current_thread);
68 INLINE
const CycleDataType *
read_stage(
int pipeline_stage,
Thread *current_thread)
const;
74 INLINE CycleDataType *
cheat()
const;
80 CycleDataType _typed_data;
81 #endif // !DO_PIPELINING
94 #define OPEN_ITERATE_UPSTREAM_ONLY(cycler, current_thread) { \
95 CyclerHolder cholder(cycler); \
97 for (pipeline_stage = current_thread->get_pipeline_stage() - 1; \
98 pipeline_stage >= 0; \
101 #define CLOSE_ITERATE_UPSTREAM_ONLY(cycler) \
106 #define OPEN_ITERATE_CURRENT_AND_UPSTREAM(cycler, current_thread) { \
107 CyclerHolder cholder(cycler); \
108 int pipeline_stage; \
109 for (pipeline_stage = current_thread->get_pipeline_stage(); \
110 pipeline_stage >= 0; \
113 #define CLOSE_ITERATE_CURRENT_AND_UPSTREAM(cycler) \
117 #define OPEN_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(cycler, current_thread) { \
118 int pipeline_stage; \
119 for (pipeline_stage = current_thread->get_pipeline_stage(); \
120 pipeline_stage >= 0; \
123 #define CLOSE_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(cycler) \
127 #define OPEN_ITERATE_ALL_STAGES(cycler) { \
128 int pipeline_stage; \
129 for (pipeline_stage = (cycler).get_num_stages() - 1; \
130 pipeline_stage >= 0; \
133 #define CLOSE_ITERATE_ALL_STAGES(cycler) \
136 #else // DO_PIPELINING
141 #define OPEN_ITERATE_UPSTREAM_ONLY(cycler, current_thread) \
143 const int pipeline_stage = -1;
145 #define CLOSE_ITERATE_UPSTREAM_ONLY(cycler) \
148 #define OPEN_ITERATE_CURRENT_AND_UPSTREAM(cycler, current_thread) { \
149 const int pipeline_stage = 0; \
151 #define CLOSE_ITERATE_CURRENT_AND_UPSTREAM(cycler) \
154 #define OPEN_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(cycler, current_thread) { \
155 const int pipeline_stage = 0; \
157 #define CLOSE_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(cycler) \
160 #define OPEN_ITERATE_ALL_STAGES(cycler) { \
161 const int pipeline_stage = 0; \
163 #define CLOSE_ITERATE_ALL_STAGES(cycler) \
166 #endif // DO_PIPELINING
168 #include "pipelineCycler.I"
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
CycleDataType * elevate_read(const CycleDataType *pointer, Thread *current_thread)
See PipelineCyclerBase::elevate_read().
This is the trivial, non-threaded implementation of PipelineCyclerBase.
CycleDataType * elevate_read_stage_upstream(int pipeline_stage, const CycleDataType *pointer, bool force_to_0, Thread *current_thread)
See PipelineCyclerBase::elevate_read_stage_upstream().
CycleDataType * elevate_read_stage(int pipeline_stage, const CycleDataType *pointer, Thread *current_thread)
See PipelineCyclerBase::elevate_read_stage().
CycleDataType * write_stage_upstream(int pipeline_stage, bool force_to_0, Thread *current_thread)
See PipelineCyclerBase::write_stage_upstream().
CycleDataType * cheat() const
Returns a pointer without counting it.
const CycleDataType * read(Thread *current_thread) const
See PipelineCyclerBase::read().
CycleDataType * write_stage(int pipeline_stage, Thread *current_thread)
See PipelineCyclerBase::write_stage().
This class manages a staged pipeline of data, for instance the render pipeline, so that each stage of...
CycleDataType * write(Thread *current_thread)
See PipelineCyclerBase::write().
CycleDataType * elevate_read_upstream(const CycleDataType *pointer, bool force_to_0, Thread *current_thread)
See PipelineCyclerBase::elevate_read_upstream().
A thread; that is, a lightweight process.
CycleDataType * write_upstream(bool force_to_0, Thread *current_thread)
See PipelineCyclerBase::write_upstream().
const CycleDataType * read_unlocked(Thread *current_thread) const
See PipelineCyclerBase::read_unlocked().
const CycleDataType * read_stage(int pipeline_stage, Thread *current_thread) const
See PipelineCyclerBase::read_stage().
const CycleDataType * read_stage_unlocked(int pipeline_stage) const
See PipelineCyclerBase::read_stage_unlocked().