diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index 4faa25548b..4b2ad99f98 100644 --- a/direct/src/filter/FilterManager.py +++ b/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 diff --git a/doc/man/bam-info.1 b/doc/man/bam-info.1 index c9432acd7a..b830554603 100644 --- a/doc/man/bam-info.1 +++ b/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. diff --git a/makepanda/test_wheel.py b/makepanda/test_wheel.py index 4efdd6b6bd..959c1920f0 100755 --- a/makepanda/test_wheel.py +++ b/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) diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index 4629a38f75..cddfd2b4a5 100644 --- a/panda/src/display/displayRegion.cxx +++ b/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. diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 280edaa333..0aa9d2b998 100644 --- a/panda/src/display/displayRegion.h +++ b/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: diff --git a/panda/src/display/graphicsPipeSelection.cxx b/panda/src/display/graphicsPipeSelection.cxx index cdf68c3d1c..8be3f856a8 100644 --- a/panda/src/display/graphicsPipeSelection.cxx +++ b/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"; } diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 0b4013f7ae..35f86ae3d0 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/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; } diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index cc9845ccc1..289ca4530a 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/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 diff --git a/panda/src/putil/bitArray.cxx b/panda/src/putil/bitArray.cxx index aab43ee99e..e7364584f6 100644 --- a/panda/src/putil/bitArray.cxx +++ b/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(); } diff --git a/pandatool/src/bam/bamInfo.cxx b/pandatool/src/bam/bamInfo.cxx index a30a5066dd..291d33798c 100644 --- a/pandatool/src/bam/bamInfo.cxx +++ b/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; diff --git a/tests/linmath/test_lvector2.py b/tests/linmath/test_lvector2.py index 9b77076fa2..bbf658dead 100644 --- a/tests/linmath/test_lvector2.py +++ b/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) +@pytest.mark.xfail(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): diff --git a/tests/linmath/test_lvector3.py b/tests/linmath/test_lvector3.py index 2e1ceae67d..1b6dc02995 100644 --- a/tests/linmath/test_lvector3.py +++ b/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) +@pytest.mark.xfail(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): diff --git a/tests/linmath/test_lvector4.py b/tests/linmath/test_lvector4.py index 0127359c50..8e651472a6 100644 --- a/tests/linmath/test_lvector4.py +++ b/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) +@pytest.mark.xfail(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):