Explorar o código

threading fixes

David Rose %!s(int64=19) %!d(string=hai) anos
pai
achega
33d94245bd

+ 2 - 1
panda/src/gobj/geom.cxx

@@ -1359,7 +1359,8 @@ check_usage_hint() const {
     // already have modified the pointer on the object since we
     // queried it.
     {
-      Geom::CDWriter fresh_cdata(((Geom *)_object)->_cycler, _current_thread);
+      Geom::CDWriter fresh_cdata(((Geom *)_object)->_cycler, 
+                                 false, _current_thread);
       if (!fresh_cdata->_got_usage_hint) {
         // The cache is still stale.  We have to do the work of
         // freshening it.

+ 2 - 1
panda/src/gobj/geomPrimitive.cxx

@@ -1504,7 +1504,8 @@ check_minmax() const {
     // already have modified the pointer on the object since we
     // queried it.
     {
-      GeomPrimitive::CDWriter fresh_cdata(((GeomPrimitive *)_object)->_cycler, _current_thread);
+      GeomPrimitive::CDWriter fresh_cdata(((GeomPrimitive *)_object)->_cycler, 
+                                          false, _current_thread);
       if (!fresh_cdata->_got_minmax) {
         // The cache is still stale.  We have to do the work of
         // freshening it.

+ 1 - 0
panda/src/pipeline/pipeline.cxx

@@ -247,6 +247,7 @@ add_dirty_cycler(PipelineCyclerTrueImpl *cycler) {
   nassertv(cycler->_lock.debug_is_locked());
 
   ReMutexHolder holder(_lock);
+  nassertv(_num_stages != 1);
   nassertv(!_cycling);
   nassertv(!cycler->_dirty);
   cycler->_dirty = true;

+ 1 - 1
panda/src/pipeline/pipelineCyclerTrueImpl.cxx

@@ -162,7 +162,7 @@ write_stage(int pipeline_stage, Thread *current_thread) {
 
     // Now we have differences between some of the data pointers, so
     // we're "dirty".  Mark it so.
-    if (!_dirty) {
+    if (!_dirty && _num_stages != 1) {
       _pipeline->add_dirty_cycler(this);
     }
   }