From 32b78a382a7659c56a019acecda5039a715b36e0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 14:00:59 +0200 Subject: [PATCH 01/11] express: Protect clock debug print with is_debug() check --- panda/src/express/trueClock.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/src/express/trueClock.cxx b/panda/src/express/trueClock.cxx index f60ddc22dc..3f7d66bc60 100644 --- a/panda/src/express/trueClock.cxx +++ b/panda/src/express/trueClock.cxx @@ -243,10 +243,12 @@ correct_time(double time) { // backward in the high-precision clock, since this does appear to happen // in a threaded environment. - clock_cat.debug() - << "Clock error detected; elapsed time " << time_delta - << "s on high-resolution counter, and " << tod_delta - << "s on time-of-day clock.\n"; + if (clock_cat.is_debug()) { + clock_cat.debug() + << "Clock error detected; elapsed time " << time_delta + << "s on high-resolution counter, and " << tod_delta + << "s on time-of-day clock.\n"; + } ++_error_count; // If both are negative, we call it 0. If one is negative, we trust the From 481fc679962bff05cbab2d3f3b968cca72ad06ad Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 14:01:43 +0200 Subject: [PATCH 02/11] gles2gsg: Support gl-depth-zero-to-one in OpenGL ES 2+ Requires GL_EXT_clip_control support in the driver. --- panda/src/gles2gsg/gles2gsg.h | 2 ++ panda/src/gles2gsg/panda_esgl2ext.h | 14 ++++++++++ .../glstuff/glGraphicsStateGuardian_src.cxx | 27 ++++++++++++------- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 ++- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/panda/src/gles2gsg/gles2gsg.h b/panda/src/gles2gsg/gles2gsg.h index c328c99ac4..044ac72991 100644 --- a/panda/src/gles2gsg/gles2gsg.h +++ b/panda/src/gles2gsg/gles2gsg.h @@ -120,6 +120,8 @@ typedef char GLchar; #define GL_ONE_MINUS_SRC1_COLOR GL_ONE_MINUS_SRC1_COLOR_EXT #define GL_SRC1_ALPHA GL_SRC1_ALPHA_EXT #define GL_ONE_MINUS_SRC1_ALPHA GL_ONE_MINUS_SRC1_ALPHA_EXT +#define GL_LOWER_LEFT GL_LOWER_LEFT_EXT +#define GL_ZERO_TO_ONE GL_ZERO_TO_ONE_EXT #define GL_DEBUG_OUTPUT_SYNCHRONOUS GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR #define GL_DEBUG_TYPE_PERFORMANCE GL_DEBUG_TYPE_PERFORMANCE_KHR diff --git a/panda/src/gles2gsg/panda_esgl2ext.h b/panda/src/gles2gsg/panda_esgl2ext.h index 6d5258fff0..888e8e2553 100644 --- a/panda/src/gles2gsg/panda_esgl2ext.h +++ b/panda/src/gles2gsg/panda_esgl2ext.h @@ -1050,6 +1050,20 @@ GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, #endif #endif /* GL_EXT_buffer_storage */ +#ifndef GL_EXT_clip_control +#define GL_EXT_clip_control 1 +#define GL_LOWER_LEFT_EXT 0x8CA1 +#define GL_UPPER_LEFT_EXT 0x8CA2 +#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E +#define GL_ZERO_TO_ONE_EXT 0x935F +#define GL_CLIP_ORIGIN_EXT 0x935C +#define GL_CLIP_DEPTH_MODE_EXT 0x935D +typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth); +#endif +#endif /* GL_EXT_clip_control */ + #ifndef GL_EXT_color_buffer_float #define GL_EXT_color_buffer_float 1 #endif /* GL_EXT_color_buffer_float */ diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 4f0a30df8a..2bbeff7665 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3293,23 +3293,30 @@ reset() { #endif // Set depth range from zero to one if requested. -#ifndef OPENGLES +#ifndef OPENGLES_1 _use_depth_zero_to_one = false; _use_remapped_depth_range = false; if (gl_depth_zero_to_one) { +#ifndef OPENGLES + PFNGLCLIPCONTROLPROC pglClipControl = nullptr; if (is_at_least_gl_version(4, 5) || has_extension("GL_ARB_clip_control")) { - PFNGLCLIPCONTROLPROC pglClipControl = - (PFNGLCLIPCONTROLPROC)get_extension_func("glClipControl"); + pglClipControl = (PFNGLCLIPCONTROLPROC)get_extension_func("glClipControl"); + } +#else + PFNGLCLIPCONTROLEXTPROC pglClipControl = nullptr; + if (has_extension("GL_EXT_clip_control")) { + pglClipControl = (PFNGLCLIPCONTROLEXTPROC)get_extension_func("glClipControlEXT"); + } +#endif - if (pglClipControl != nullptr) { - pglClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE); - _use_depth_zero_to_one = true; + if (pglClipControl != nullptr) { + pglClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE); + _use_depth_zero_to_one = true; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "Set zero-to-one depth using glClipControl\n"; - } + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Set zero-to-one depth using glClipControl\n"; } }/* else if (has_extension("GL_NV_depth_buffer_float")) { // Alternatively, all GeForce 8+ and even some AMD drivers support this diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 19d4a63d68..c889545fc9 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -761,9 +761,11 @@ protected: #endif public: -#ifndef OPENGLES +#ifndef OPENGLES_1 bool _use_depth_zero_to_one; bool _use_remapped_depth_range; +#endif +#ifndef OPENGLES PFNGLDEPTHRANGEDNVPROC _glDepthRangedNV; #endif From 8c01f7fafff2385275eb3b94f2cf7afa75319468 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 14:02:41 +0200 Subject: [PATCH 03/11] gles2gsg: Implement support for GL_EXT_clear_texture in OpenGL ES 2+ --- panda/src/gles2gsg/panda_esgl2ext.h | 10 ++++++++++ panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 12 ++++++++++++ panda/src/glstuff/glGraphicsStateGuardian_src.h | 6 +++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/panda/src/gles2gsg/panda_esgl2ext.h b/panda/src/gles2gsg/panda_esgl2ext.h index 888e8e2553..a95d9b001b 100644 --- a/panda/src/gles2gsg/panda_esgl2ext.h +++ b/panda/src/gles2gsg/panda_esgl2ext.h @@ -1050,6 +1050,16 @@ GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, #endif #endif /* GL_EXT_buffer_storage */ +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 +typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +#endif +#endif /* GL_EXT_clear_texture */ + #ifndef GL_EXT_clip_control #define GL_EXT_clip_control 1 #define GL_LOWER_LEFT_EXT 0x8CA1 diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 2bbeff7665..8aba915666 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1080,6 +1080,18 @@ reset() { _supports_clear_texture = true; } } +#elif !defined(OPENGLES_1) + if (has_extension("GL_EXT_clear_texture")) { + _glClearTexImage = (PFNGLCLEARTEXIMAGEEXTPROC) + get_extension_func("glClearTexImageEXT"); + + if (_glClearTexImage == nullptr) { + GLCAT.warning() + << "GL_EXT_clear_texture advertised as supported by OpenGL runtime, but could not get pointers to extension function.\n"; + } else { + _supports_clear_texture = true; + } + } #endif _supports_clear_buffer = false; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index c889545fc9..6457cc920c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -229,10 +229,10 @@ typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFo typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -#endif // OPENGLES_1 -#ifndef OPENGLES typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +#endif // OPENGLES_1 +#ifndef OPENGLES typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); @@ -804,7 +804,7 @@ public: #endif bool _supports_clear_texture; -#ifndef OPENGLES +#ifndef OPENGLES_1 PFNGLCLEARTEXIMAGEPROC _glClearTexImage; #endif From 2cc1633a772cd635bb8d95d420badf1f258b67d4 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 14:03:17 +0200 Subject: [PATCH 04/11] pgraph: Clarify in find() documentation that this node not included --- panda/src/pgraph/nodePath.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 5c7dbbbdaf..3e2430aa3c 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -309,6 +309,8 @@ get_sort(Thread *current_thread) const { * Searches for a node below the referenced node that matches the indicated * string. Returns the shortest match found, if any, or an empty NodePath if * no match can be found. + * + * The referenced node itself is not considered in the search. */ NodePath NodePath:: find(const string &path) const { @@ -349,6 +351,8 @@ find_path_to(PandaNode *node) const { /** * Returns the complete set of all NodePaths that begin with this NodePath and * can be extended by path. The shortest paths will be listed first. + * + * The referenced node itself is not considered in the search. */ NodePathCollection NodePath:: find_all_matches(const string &path) const { From b291db2556011a417844796a6ccc6ac495fb7450 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 16:56:41 +0200 Subject: [PATCH 05/11] doc: Update release notes for 1.10.10 [skip ci] --- doc/ReleaseNotes | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index d11b49b772..ccf0a771c3 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,36 @@ +----------------------- RELEASE 1.10.10 ----------------------- + +This release fixes assorted, mostly very minor bugs. + +* Round refresh rates when choosing display mode on macOS (#1144) +* Vectors now support floor division +* It is now possible to use round(), ceil() and floor() with vector types +* Add RenderState::get_unused_states() +* Fix assertion error in RenderState::get_num_unused_states() +* Fix Assimp loader not importing normal vectors correctly (#1163) +* Fix error when trying to render DirectGUI in offscreen mode (#1174) +* Fix crash when resizing window in multi-window DirectX 9 application (#1167) +* Fixes to enable compilation with recent OpenEXR and FFMpeg versions +* Fix draw callback being called twice if cull callback calls upcall() +* Improve error message when display module fails to load +* Fix writing/reading BitArray to/from bam files on 64-bit systems (#1181) +* evdev input devices (such as gamepads) are now supported in FreeBSD as well +* Panda no longer tries to compress buffer textures when compression is enabled +* Fix Geom::make_lines_in_place() (& points, patches) leaving invalid state +* Fix memory leak when cleaning up FilterManager (#1166) +* Fix memory leak deleting multisample OpenGL FBOs (#1166) +* Fix auto-binding of SSBOs sometimes causing overlapping bindings (#1176) +* PSSMCameraRig::update() now accepts a camera node directly +* Support copying depth buffer for 32-bit depth with 8-bit stencil (#1142) +* Prevent trying to copy depth from non-depth buffer in OpenGL renderer (#1142) +* Fixes to format selection for OpenGL renderbuffers (#1137, #1141) +* gl-depth-zero-to-one is now supported in OpenGL ES 2+ (if driver supports) +* Maya models can contain more than three eggObjectTypes (#1134) +* Fix black screen on Linux when switching fullscreen without a WM active +* Fix Linux crash when trying to load a directory instead of a file (#1140) +* Fix crash when loading an invalid font +* Fix a very obscure unintended DirectGUI behavior change in 1.10.9 + ------------------------ RELEASE 1.10.9 ----------------------- This is a bugfix release which addresses some severe issues on macOS, as well as From 3d386d2d630d928d6847bb41641073dbef592f19 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 18:14:26 +0200 Subject: [PATCH 06/11] dist: Default to manylinux2010 for Python 3.10+ manylinux1 is not being offered for Python 3.10, so no thirdparty package will have wheels available for this --- direct/src/dist/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 5a81ec49dc..47422a7e47 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -242,6 +242,9 @@ class build_apps(setuptools.Command): 'macosx_10_6_x86_64', 'win_amd64', ] + if sys.version_info >= (3, 10): + # manylinux1 is not offered for Python 3.10 anymore + self.platforms[0] = 'manylinux2010_x86_64' if sys.version_info >= (3, 8): # This version of Python is only available for 10.9+. self.platforms[1] = 'macosx_10_9_x86_64' @@ -1393,6 +1396,8 @@ class bdist_apps(setuptools.Command): DEFAULT_INSTALLERS = { 'manylinux1_x86_64': ['gztar'], 'manylinux1_i686': ['gztar'], + 'manylinux2010_x86_64': ['gztar'], + 'manylinux2010_i686': ['gztar'], # Everything else defaults to ['zip'] } From cb4bcbe67ecbc5833ec4dcd39df35a76aede800b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 21:27:53 +0200 Subject: [PATCH 07/11] collide: Fix typo causing compile error on Windows with Python 3.10 --- panda/src/collide/collisionTraverser_ext.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/collide/collisionTraverser_ext.cxx b/panda/src/collide/collisionTraverser_ext.cxx index 5dd6c171f6..460fab54aa 100644 --- a/panda/src/collide/collisionTraverser_ext.cxx +++ b/panda/src/collide/collisionTraverser_ext.cxx @@ -69,7 +69,7 @@ __setstate__(PyObject *state) { _this->set_name(std::string(data, len)); _this->set_respect_prev_transform(PyTuple_GET_ITEM(state, 1) != Py_False); - size_t num_colliders = (ssize_t)PyLong_AsLong(PyTuple_GET_ITEM(state, 2)); + size_t num_colliders = (size_t)PyLong_AsLong(PyTuple_GET_ITEM(state, 2)); for (size_t i = 0; i < num_colliders; ++i) { NodePath *collider = (NodePath *)DtoolInstance_VOID_PTR(PyTuple_GET_ITEM(state, i * 2 + 3)); From 1fe5632ce20a8786f9d6f9d34c7ecdd2828d9138 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 21:35:50 +0200 Subject: [PATCH 08/11] interrogatedb: Fix compilation error on Windows due to typo --- dtool/src/interrogatedb/py_wrappers.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/py_wrappers.cxx b/dtool/src/interrogatedb/py_wrappers.cxx index 6aed3d2bbb..7bcd57944c 100644 --- a/dtool/src/interrogatedb/py_wrappers.cxx +++ b/dtool/src/interrogatedb/py_wrappers.cxx @@ -371,7 +371,7 @@ static PyObject *Dtool_MutableSequenceWrapper_insert(PyObject *self, PyObject *a return PyErr_Format(PyExc_TypeError, "%s.insert() does not support negative indices", wrap->_base._name); } } - return wrap->_insert_func(wrap->_base._self, (ssize_t)std::max(index, (Py_ssize_t)0), PyTuple_GET_ITEM(args, 1)); + return wrap->_insert_func(wrap->_base._self, (size_t)std::max(index, (Py_ssize_t)0), PyTuple_GET_ITEM(args, 1)); } /** From 6ac4af2f0b2d5135a723d81adbe1fd6c8ee20403 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 31 Aug 2021 09:17:31 +0200 Subject: [PATCH 09/11] Update BACKERS.md [skip ci] --- BACKERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BACKERS.md b/BACKERS.md index 86fc18b77d..c34cb2a9d3 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -34,6 +34,7 @@ This is a list of all the people who are contributing financially to Panda3D. I * Kyle Roach * Brian Lach * C0MPU73R +* Maxwell Dreytser ## Backers From 47836f11d802762ef89d452dd6e33b31f74c41f7 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 31 Aug 2021 09:17:59 +0200 Subject: [PATCH 10/11] readme: Update links for 1.10.10 [skip ci] --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc2404ee95..3be11f9b58 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Installing Panda3D ================== The latest Panda3D SDK can be downloaded from -[this page](https://www.panda3d.org/download/sdk-1-10-9/). +[this page](https://www.panda3d.org/download/sdk-1-10-10/). If you are familiar with installing Python packages, you can use the following command: @@ -64,8 +64,8 @@ depending on whether you are on a 32-bit or 64-bit system, or you can [click here](https://github.com/rdb/panda3d-thirdparty) for instructions on building them from source. -- https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-win64.zip -- https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-win32.zip +- https://www.panda3d.org/download/panda3d-1.10.10/panda3d-1.10.10-tools-win64.zip +- https://www.panda3d.org/download/panda3d-1.10.10/panda3d-1.10.10-tools-win32.zip After acquiring these dependencies, you can build Panda3D from the command prompt using the following command. Change the `--msvc-version` option based @@ -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.9/panda3d-1.10.9-tools-mac.tar.gz). +compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.10/panda3d-1.10.10-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 58879e05c9b566c15515f724ec65bc7179de1655 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 31 Aug 2021 11:31:24 +0200 Subject: [PATCH 11/11] Add Python 3.10 to setup.cfg [skip ci] --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index c3e6552be1..44e2b5dbef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Topic :: Games/Entertainment Topic :: Multimedia