From 0358abfc0e8ea98c8a8a8c79538a06f785c6fd04 Mon Sep 17 00:00:00 2001 From: tobspr Date: Sat, 6 Dec 2014 14:31:28 +0100 Subject: [PATCH] Added clear_dispatches() to ComputeNode Signed-off-by: rdb --- panda/src/pgraphnodes/computeNode.I | 11 +++++++++++ panda/src/pgraphnodes/computeNode.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/panda/src/pgraphnodes/computeNode.I b/panda/src/pgraphnodes/computeNode.I index f841af6309..726193e8b1 100644 --- a/panda/src/pgraphnodes/computeNode.I +++ b/panda/src/pgraphnodes/computeNode.I @@ -41,6 +41,17 @@ add_dispatch(int num_groups_x, int num_groups_y, int num_groups_z) { add_dispatch(num_groups); } +//////////////////////////////////////////////////////////////////// +// Function: ComputeNode::clear_dispatches +// Access: Published +// Description: Removes all dispatch commands. +//////////////////////////////////////////////////////////////////// +INLINE void ComputeNode:: +clear_dispatches() { + Dispatcher::CDWriter cdata(_dispatcher->_cycler); + cdata->_dispatches.clear(); +} + //////////////////////////////////////////////////////////////////// // Function: ComputeNode::get_num_dispatches // Access: Published diff --git a/panda/src/pgraphnodes/computeNode.h b/panda/src/pgraphnodes/computeNode.h index d6b835d6ce..94f2086c10 100644 --- a/panda/src/pgraphnodes/computeNode.h +++ b/panda/src/pgraphnodes/computeNode.h @@ -36,6 +36,8 @@ PUBLISHED: INLINE int get_num_dispatches() const; INLINE const LVecBase3i &get_dispatch(int i) const; + INLINE void clear_dispatches(); + MAKE_SEQ(get_dispatches, get_num_dispatches, get_dispatch); public: