15 #include "pandabase.h"
16 #include "computeNode.h"
17 #include "cullTraverser.h"
18 #include "cullableObject.h"
19 #include "cullHandler.h"
20 #include "geomDrawCallbackData.h"
21 #include "omniBoundingVolume.h"
22 #include "config_pgraph.h"
49 _dispatcher(new
ComputeNode::Dispatcher(*copy._dispatcher))
106 if (pgraph_cat.is_spam()) {
108 <<
"Found " << *
this <<
" in state " << *data._state
109 <<
" draw_mask = " << data._draw_mask <<
"\n";
117 data.get_internal_transform(trav));
132 PandaNode::output(out);
140 ComputeNode::Dispatcher::
149 ComputeNode::Dispatcher::
150 Dispatcher(
const Dispatcher ©) :
151 _cycler(copy._cycler)
167 Dispatches::const_iterator it;
168 for (it = cdata->_dispatches.begin(); it != cdata->_dispatches.end(); ++it) {
169 gsg->dispatch_compute(it->get_x(), it->get_y(), it->get_z());
212 parse_params(params, scan, manager);
213 node->fillin(scan, manager);
227 PandaNode::fillin(scan, manager);
228 manager->
read_cdata(scan, _dispatcher->_cycler);
236 CycleData *ComputeNode::Dispatcher::CData::
238 return new CData(*
this);
251 Dispatches::const_iterator it;
252 for (it = _dispatches.begin(); it != _dispatches.end(); ++it) {
253 generic_write_datagram(dg, *it);
267 _dispatches.resize(num_dispatches);
269 for (
int i = 0; i < num_dispatches; ++i) {
270 generic_read_datagram(_dispatches[i], scan);
This specialization on CallbackData is passed when the callback is initiated from deep within the dra...
A basic node of the scene graph or data graph.
virtual void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type ComputeNode.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is a generic data block that is passed along to a CallbackObject when a callback is made...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
GraphicsStateGuardianBase * get_gsg() const
Returns a pointer to the current GSG.
The smallest atom of cull.
virtual void record_object(CullableObject *object, const CullTraverser *traverser)
This callback function is intended to be overridden by a derived class.
virtual void do_callback(CallbackData *cbdata)
Asks the GSG to dispatch the compute shader.
CullHandler * get_cull_handler() const
Returns the object that will receive the culled Geoms.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void add_for_draw(CullTraverser *trav, CullTraverserData &data)
Adds the node's contents to the CullResult we are building up during the cull traversal, so that it will be drawn at render time.
A special node, the sole purpose of which is to invoke a dispatch operation on the assigned compute s...
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is called by make_from_bam to read in all of the relevant data from the BamFil...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
void add_uint16(PN_uint16 value)
Adds an unsigned 16-bit integer to the datagram.
void set_draw_callback(CallbackObject *draw_callback)
Specifies a CallbackObject that will be responsible for drawing this object.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
ComputeNode(const string &name)
Creates a ComputeNode with the given name.
virtual void output(ostream &out) const
Writes a brief description of the node to the indicated output stream.
This is a special kind of GeometricBoundingVolume that fills all of space.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.