2
0
Эх сурвалжийг харах

Merge branch 'release/1.10.x'

rdb 4 жил өмнө
parent
commit
c293ad3da2

+ 2 - 0
direct/src/filter/FilterManager.py

@@ -367,6 +367,8 @@ class FilterManager(DirectObject):
         self.camstate = self.caminit
         self.camera.node().setInitialState(self.caminit)
         self.region.setCamera(self.camera)
+        if hasattr(self.region, 'clearCullResult'):
+            self.region.clearCullResult()
         self.nextsort = self.win.getSort() - 9
         self.basex = 0
         self.basey = 0

+ 1 - 1
doc/man/bam-info.1

@@ -15,7 +15,7 @@ List the scene graph hierarchy in the bam file.
 List explicitly each transition in the hierarchy.
 .TP
 .B \-g
-Output verbose information about the each Geom in the Bam file.
+Output verbose information about each Geom in the Bam file.
 .TP
 .B \-h
 Display this help page.

+ 6 - 2
makepanda/test_wheel.py

@@ -38,8 +38,12 @@ def test_wheel(wheel, verbose=False):
 
     # Install pytest into the environment, as well as our wheel.
     packages = ["pytest", wheel]
-    if sys.version_info[0:2] == (3, 4) and sys.platform == "win32":
-        packages += ["colorama==0.4.1"]
+    if sys.version_info[0:2] == (3, 4):
+        if sys.platform == "win32":
+            packages += ["colorama==0.4.1"]
+
+        # See https://github.com/python-attrs/attrs/pull/807
+        packages += ["attrs<21"]
 
     if subprocess.call([python, "-m", "pip", "install"] + packages) != 0:
         shutil.rmtree(envdir)

+ 9 - 0
panda/src/display/displayRegion.cxx

@@ -514,6 +514,15 @@ get_screenshot() {
   return tex;
 }
 
+/**
+ *
+ */
+void DisplayRegion::
+clear_cull_result() {
+  CDCullWriter cdata_cull(_cycler_cull, true);
+  cdata_cull->_cull_result = nullptr;
+}
+
 /**
  * Returns a special scene graph constructed to represent the results of the
  * last frame's cull operation.

+ 1 - 0
panda/src/display/displayRegion.h

@@ -160,6 +160,7 @@ PUBLISHED:
   bool get_screenshot(PNMImage &image);
   PT(Texture) get_screenshot();
 
+  void clear_cull_result();
   virtual PT(PandaNode) make_cull_result_graph();
 
 public:

+ 3 - 3
panda/src/display/graphicsPipeSelection.cxx

@@ -399,7 +399,7 @@ load_named_module(const string &name) {
   if (handle == nullptr) {
     std::string error = load_dso_error();
     display_cat.warning()
-      << "Unable to load " << dlname.get_basename() << ": " << error << std::endl;
+      << "Unable to load " << dlname.to_os_specific() << ": " << error << std::endl;
     return TypeHandle::none();
   }
 
@@ -417,7 +417,7 @@ load_named_module(const string &name) {
   if (dso_symbol == nullptr) {
     // Couldn't find the module function.
     display_cat.warning()
-      << "Unable to find " << symbol_name << " in " << dlname.get_basename()
+      << "Unable to find " << symbol_name << " in " << dlname.to_os_specific()
       << "\n";
 
   } else {
@@ -447,7 +447,7 @@ load_named_module(const string &name) {
     // though, because it may have assigned itself into the
     // GraphicsPipeSelection table.  So we carry on.
     display_cat.warning()
-      << "No default pipe type available for " << dlname.get_basename()
+      << "No default pipe type available for " << dlname.to_os_specific()
       << "\n";
   }
 

+ 3 - 0
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -4782,6 +4782,9 @@ release_swap_chain(DXScreenData *new_context) {
       }
       return false;
     }
+    if (new_context->_swap_chain == _swap_chain) {
+      _swap_chain = nullptr;
+    }
   }
   return true;
 }

+ 5 - 0
panda/src/glstuff/glGraphicsBuffer_src.cxx

@@ -1695,6 +1695,11 @@ close_buffer() {
     _fbo.clear();
   }
 
+  if (_fbo_multisample != 0) {
+    glgsg->_glDeleteFramebuffers(1, &_fbo_multisample);
+    _fbo_multisample = 0;
+  }
+
   report_my_gl_errors();
 
   // Release the Gsg

+ 18 - 8
panda/src/putil/bitArray.cxx

@@ -909,10 +909,14 @@ normalize() {
  */
 void BitArray::
 write_datagram(BamWriter *manager, Datagram &dg) const {
-  dg.add_uint32(_array.size());
-  Array::const_iterator ai;
-  for (ai = _array.begin(); ai != _array.end(); ++ai) {
-    dg.add_uint32((*ai).get_word());
+  dg.add_uint32(_array.size() * (num_bits_per_word >> 5));
+
+  for (MaskType &item : _array) {
+    WordType word = item.get_word();
+    for (size_t i = 0; i < num_bits_per_word; i += 32) {
+      dg.add_uint32(word);
+      word >>= 32;
+    }
   }
   dg.add_uint8(_highest_bits);
 }
@@ -922,10 +926,16 @@ write_datagram(BamWriter *manager, Datagram &dg) const {
  */
 void BitArray::
 read_datagram(DatagramIterator &scan, BamReader *manager) {
-  size_t num_words = scan.get_uint32();
-  _array = Array::empty_array(num_words);
-  for (size_t i = 0; i < num_words; ++i) {
-    _array[i] = WordType(scan.get_uint32());
+  size_t num_words32 = scan.get_uint32();
+  size_t num_bits = num_words32 << 5;
+
+  _array = Array::empty_array((num_bits + num_bits_per_word - 1) / num_bits_per_word);
+
+  for (size_t i = 0; i < num_bits; i += 32) {
+    int w = i / num_bits_per_word;
+    int b = i % num_bits_per_word;
+
+    _array[w].store(scan.get_uint32(), b, 32);
   }
   _highest_bits = scan.get_uint8();
 }

+ 1 - 1
pandatool/src/bam/bamInfo.cxx

@@ -50,7 +50,7 @@ BamInfo() {
 
   add_option
     ("g", "", 0,
-     "Output verbose information about the each Geom in the Bam file.",
+     "Output verbose information about each Geom in the Bam file.",
      &BamInfo::dispatch_none, &_verbose_geoms);
 
   _num_scene_graphs = 0;

+ 2 - 0
tests/linmath/test_lvector2.py

@@ -1,4 +1,5 @@
 from math import floor, ceil
+import sys
 
 from panda3d.core import Vec2, Vec3, Vec4, Vec2F, Vec2D
 from panda3d import core
@@ -124,6 +125,7 @@ def test_vec2_rmul():
     assert 2 * Vec2(3, -4) == Vec2(6, -8)
 
 
[email protected](sys.platform == "win32", reason="unknown precision issue")
 @pytest.mark.parametrize("type", (core.LVecBase2f, core.LVecBase2d, core.LVecBase2i))
 def test_vec2_floordiv(type):
     with pytest.raises(ZeroDivisionError):

+ 2 - 0
tests/linmath/test_lvector3.py

@@ -1,4 +1,5 @@
 from math import floor, ceil
+import sys
 
 from panda3d.core import Vec2, Vec3, Vec3F, Vec3D
 from panda3d import core
@@ -109,6 +110,7 @@ def test_vec3_rmul():
     assert 2 * Vec3(0, 3, -4) == Vec3(0, 6, -8)
 
 
[email protected](sys.platform == "win32", reason="unknown precision issue")
 @pytest.mark.parametrize("type", (core.LVecBase3f, core.LVecBase3d, core.LVecBase3i))
 def test_vec3_floordiv(type):
     with pytest.raises(ZeroDivisionError):

+ 2 - 0
tests/linmath/test_lvector4.py

@@ -1,4 +1,5 @@
 from math import floor, ceil
+import sys
 
 from panda3d.core import Vec2, Vec3, Vec4, Vec4F, Vec4D
 from panda3d import core
@@ -125,6 +126,7 @@ def test_vec4_rmul():
     assert 2 * Vec4(0, 3, -4, 0.5) == Vec4(0, 6, -8, 1)
 
 
[email protected](sys.platform == "win32", reason="unknown precision issue")
 @pytest.mark.parametrize("type", (core.LVecBase4f, core.LVecBase4d, core.LVecBase4i))
 def test_vec4_floordiv(type):
     with pytest.raises(ZeroDivisionError):