فهرست منبع

Added clear_dispatches() to ComputeNode

Signed-off-by: rdb <[email protected]>
tobspr 11 سال پیش
والد
کامیت
0358abfc0e
2فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 11 0
      panda/src/pgraphnodes/computeNode.I
  2. 2 0
      panda/src/pgraphnodes/computeNode.h

+ 11 - 0
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

+ 2 - 0
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: