From 5291048b0fe3f69cca719ced5c7ea953c653f8f4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 17 Mar 2019 22:18:08 +0100 Subject: [PATCH 1/6] samples: add info about ShaderTerrainMesh optimization config vars (Cherry-pick from master) [skip ci] --- samples/shader-terrain/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/shader-terrain/main.py b/samples/shader-terrain/main.py index 8d500b4d05..5121992642 100644 --- a/samples/shader-terrain/main.py +++ b/samples/shader-terrain/main.py @@ -21,6 +21,14 @@ class ShaderTerrainDemo(ShowBase): gl-coordinate-system default window-title Panda3D ShaderTerrainMesh Demo filled-wireframe-apply-shader true + + # As an optimization, set this to the maximum number of cameras + # or lights that will be rendering the terrain at any given time. + stm-max-views 8 + + # Further optimize the performance by reducing this to the max + # number of chunks that will be visible at any given time. + stm-max-chunk-count 2048 """) # Initialize the showbase From 709c1eb3781149a06898e82a6ab5ae916c15f417 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 24 Mar 2021 15:17:30 +0100 Subject: [PATCH 2/6] Update release notes for 1.10.9 [skip ci] --- doc/ReleaseNotes | 95 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 392589b07c..d11b49b772 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,98 @@ +------------------------ RELEASE 1.10.9 ----------------------- + +This is a bugfix release which addresses some severe issues on macOS, as well as +a broad range of issues on other platforms, and adds some minor features. + +Shaders +* Some macOS builds were erroneously not built with Cg shader support (#1119) +* Show error for unrecognized p3d_TextureXYZ GLSL shader inputs +* Fix Cg shader bug when using multiple GraphicsStateGuardian objects (#1117) +* New filled wireframe mode that respects vertex shaders (#1124) +* Fix undefined behavior when using non-nearest filtering on isampler/usampler +* Harmless shader linking warnings on macOS are now suppressed + +Windowing +* Fix mouse confinement activating on Windows for non-foreground window (#1115) +* Fix occasional failure with switching to fullscreen on macOS (#1039) +* Fix parented window being offset if undecorated flag isn't set on Windows + +Rendering +* Better support for headless OpenGL on Linux via EGL-based fallback (#1086) +* EGL implementation can now fall back to alternative EGL devices +* Fix ability to create multisample FBO when using EGL (#1089) +* Fix copy-RAM and copy-texture modes for multisample-enabled buffers (#1129) +* FilterManager now respects depth-bits specified in Config.prc +* Auto-convert vertex data down from 64-bit float to 32-bit in OpenGL ES + +Texturing +* Add missing 16-bpc and 32-bpc integer texture formats +* Support `Texture::set_ram_image_as()` for 3D and multiview textures (#1095) +* TexturePeeker now supports cube maps (#1098) +* TexturePeeker now supports integer texture formats + +GUI / Text +* Workarounds for disappearing text and GUI items in multithreaded pipeline +* Fix generated accent marks for some fonts appearing flipped +* Included static fonts now include dotless i glyph +* Fix DirectOptionMenu issues when changing items from item callback (#1125) + +Python API +* Fix some Python 3 compatibility issues +* Improvements to `direct.stdpy.pickle` pickle, esp. for Python 3 +* Fix `direct.stdpy.pickle` sometimes duplicating Panda objects +* Add pickle support to various Panda classes +* AsyncFuture can now store an arbitrary Python object as result +* AsyncFuture.gather() now schedules coroutines on current task chain +* Coroutine exceptions are no longer suppressed in optimized builds +* Add ability to `await` all interval objects inside a coroutine (#909) +* Fix garbled data when doing `base.win.properties.size` et al. +* Fix Filename division operator in Python 3 +* Add Pythonic property syntax to various Panda classes +* Add optional `delay=` argument to `taskMgr.add()` +* Fix CollisionHandler's again_patterns property + +Physics / Collisions +* Fix missing import in nodePath.subdivideCollisions() (#1084) +* Support pickling of CollisionTraverser and CollisionHandler objects (#1090) +* Improve CollisionBox debug visualization +* Fix broken GlobalForceGroup module +* Fix writing representation of AngularVectorForce +* Better handling for some edge cases in PhysicalNode +* Support bam serialization of BulletGhostNode objects (#1099) + +Deployment +* Fix app immediately exiting on Windows if log_filename is not set +* Allow generating log files with date/time in filename (#1103) +* Automatically removes aux-display Config.prc lines for excluded plug-ins +* No longer defaults to FMOD audio on macOS unless FMOD is explicitly bundled +* Fix every app pulling in pep517 and numpy when building on some Linux distros +* Fix building with pytz and pandas requirements +* Some deterministic build support with PYTHONHASHSEED=0 and SOURCE_DATE_EPOCH +* Fix harmless warnings about missing dependencies +* Fix libbz2, libreadline and liblzma libraries being erroneously excluded + +Build / C++ +* Some macOS builds were erroneously not built with Cg shader support (#1119) +* Fix code signatures being missing from arm64 wheels on macOS (#1123) +* Windows builds now include missing DirectX 9 DLL (#1034) +* Windows installer no longer pops up message box in silent mode (#1088) +* Fix compatibility of Panda headers with C++17 and C++20 compilers +* Support reproducible builds when SOURCE_DATE_EPOCH is set +* Interrogate supports `__truediv__` and `__floordiv__` special methods +* makepanda now looks for linux-libs-arm64 thirdparty directory in aarch64 build + +Miscellaneous +* Assorted memory leaks fixed +* Disable `vorbis-seek-lap`, which caused popping in ogg sounds (#1108) +* Fix crash when playing video using older FFMpeg versions (#1085) +* Fix flattening/egg loader bug messing up line strip geometry (#1122) +* Fix egg lexer state not being cleaned up after error +* multify respects SOURCE_DATE_EPOCH (but -T0 should be preferred) +* Fix egg loader hanging when encountering unterminated quote or C-style comment +* VirtualFileSystem::read_file() is now implemented for HTTP mounts +* Fix regression causing crash in DIRECT tools +* Fix repeatedly clicking object in DIRECT tools cause explosion of scaling node + ------------------------ RELEASE 1.10.8 ----------------------- Recommended maintenance release. From bd218a0a7e7cb9f010ac7da76c381a2d598c1e6a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 25 Mar 2021 10:28:45 +0100 Subject: [PATCH 3/6] readme: Update macOS thirdparty link to point to 1.10.9 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dd869b468..554b07903d 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ macOS ----- On macOS, you will need to download a set of precompiled thirdparty packages in order to -compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.8/panda3d-1.10.8-tools-mac.tar.gz). +compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-mac.tar.gz). After placing the thirdparty directory inside the panda3d source directory, you may build Panda3D using a command like the following: From 8accdf1136f259257717763a89431cab28685741 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 25 Mar 2021 10:33:04 +0100 Subject: [PATCH 4/6] makewheel: Fix Python 2.7 build on macOS --- makepanda/makewheel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/makepanda/makewheel.py b/makepanda/makewheel.py index b9de5fd225..771a9eb41a 100644 --- a/makepanda/makewheel.py +++ b/makepanda/makewheel.py @@ -405,7 +405,12 @@ class WheelFile(object): # Now add dependencies. On macOS, fix @loader_path references. if sys.platform == "darwin": - is_unsigned = subprocess.call(['codesign', '-d', temp.name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + if sys.version_info >= (3, 3): + devnull = subprocess.DEVNULL + else: + devnull = open(os.devnull, 'wb') + is_unsigned = subprocess.call(['codesign', '-d', temp.name], stdout=devnull, stderr=devnull) + if source_path.endswith('deploy-stubw'): deps_path = '@executable_path/../Frameworks' else: From 6e0af8abe4ae939eab629d848c232ebc9cdedcd0 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 25 Mar 2021 15:37:52 +0100 Subject: [PATCH 5/6] physics: Fix Mac OS X 10.6 compilation issue with header --- panda/src/physics/physicalNode.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/physics/physicalNode.cxx b/panda/src/physics/physicalNode.cxx index 18858b6201..87b8216eb1 100644 --- a/panda/src/physics/physicalNode.cxx +++ b/panda/src/physics/physicalNode.cxx @@ -14,7 +14,9 @@ #include "physicalNode.h" #include "physicsManager.h" +#ifdef PHAVE_ATOMIC #include +#endif // static stuff. static std::atomic_flag warned_copy_physical_node = ATOMIC_FLAG_INIT; From c36fa1ef174aab08a2e9a2beb4ba029756a6b469 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 25 Mar 2021 22:59:35 +0100 Subject: [PATCH 6/6] glgsg: Workaround driver bug causing flickering in AMD RDNA cards Apparently, the use of glColorPointer with GL_BGRA causes these cards to display garbled vertex colors (tested with RX 5700 XT). This bug doesn't seem to affect glVertexAttribPointer. The "fix" is to just disable packed-dabc colors if these cards are detected. This may cause a minor performance regression since the vertex data now needs to be munged--possibly even unnecessarily, if shaders are used, but this effect is likely very minor (and can be addressed in other ways). Fixes #981 --- .../glstuff/glGraphicsStateGuardian_src.cxx | 27 +++++++++++++++++-- panda/src/glstuff/glmisc_src.cxx | 6 +++++ panda/src/glstuff/glmisc_src.h | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 2e997a8587..1f6fed0ba0 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1341,11 +1341,34 @@ reset() { _supports_packed_dabc = false; _supports_packed_ufloat = false; #else - _supports_packed_dabc = is_at_least_gl_version(3, 2) || + _supports_packed_dabc = (is_at_least_gl_version(3, 2) || has_extension("GL_ARB_vertex_array_bgra") || - has_extension("GL_EXT_vertex_array_bgra"); + has_extension("GL_EXT_vertex_array_bgra")) && gl_support_vertex_array_bgra; + _supports_packed_ufloat = is_at_least_gl_version(4, 4) || has_extension("GL_ARB_vertex_type_10f_11f_11f_rev"); + + if (_supports_packed_dabc) { + int number = 0; + if (_gl_renderer.compare(0, 14, "AMD Radeon RX ") == 0) { + number = atoi(_gl_renderer.c_str() + 14); + } + else if (_gl_renderer.compare(0, 10, "Radeon RX ") == 0) { + number = atoi(_gl_renderer.c_str() + 10); + } + + // This is buggy for RDNA cards. Verified on 5700 XT, reportedly also + // occurs on the entire 5*00 and 6*00 line. + if (number >= 5000 && number < 8000) { + _supports_packed_dabc = false; + + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Detected AMD Radeon RX " << number + << ", disabling use of GL_BGRA vertex attributes\n"; + } + } + } #endif #ifdef OPENGLES diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 49eaf78a69..2c388985f6 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -304,6 +304,12 @@ ConfigVariableBool gl_support_shadow_filter "cards suffered from a broken implementation of the " "shadow map filtering features.")); +ConfigVariableBool gl_support_vertex_array_bgra + ("gl-support-vertex-array-bgra", true, + PRC_DESC("Disable this if you suspect a bug in the driver implementation " + "of GL_BGRA vertex arrays. The Radeon RX 5700 XT is an example " + "of a card known to suffer from bugs with this feature.")); + ConfigVariableBool gl_force_image_bindings_writeonly ("gl-force-image-bindings-writeonly", false, PRC_DESC("Forces all image inputs (not textures!) to be bound as writeonly, " diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index 415286c674..b815e76ae8 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -81,6 +81,7 @@ extern ConfigVariableBool gl_fixed_vertex_attrib_locations; extern ConfigVariableBool gl_support_primitive_restart_index; extern ConfigVariableBool gl_support_sampler_objects; extern ConfigVariableBool gl_support_shadow_filter; +extern ConfigVariableBool gl_support_vertex_array_bgra; extern ConfigVariableBool gl_force_image_bindings_writeonly; extern ConfigVariableEnum gl_coordinate_system;