From c5d6bae1c39bf0a1887bf9d00baed74d32b6444c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 9 Mar 2023 10:58:10 +0100 Subject: [PATCH 1/2] glgsg: Work around Panfrost driver bug with wireframe mode --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index fa6db72522..0a8b769bf6 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -818,7 +818,7 @@ reset() { _supported_geom_rendering = #ifndef OPENGLES - Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point | + Geom::GR_render_mode_point | #endif Geom::GR_indexed_point | Geom::GR_point | Geom::GR_point_uniform_size | @@ -827,6 +827,16 @@ reset() { Geom::GR_line_strip | Geom::GR_flat_last_vertex; +#ifndef OPENGLES + // Observed bug on PINEBOOK Pro: regular OpenGL 3.3 driver doesn't support + // wireframe mode, it just renders the solid mesh + // GL_RENDERER = Mali-T860 (Panfrost) + // GL_VERSION = 3.3 (Compatibility Profile) Mesa 22.3.6 + if (_gl_vendor != "Panfrost") { + _supported_geom_rendering |= Geom::GR_render_mode_wireframe; + } +#endif + _supports_point_parameters = false; #ifdef OPENGLES_1 From 68927cad0b1a930fbc90a3c9a6c2035cfae4fbd2 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 9 Mar 2023 11:00:02 +0100 Subject: [PATCH 2/2] interrogate: Code size reduction for generated wrappers No need to have a separate entry in the string table for every possible class for this uncommon error message --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index eb930185e6..cc184c7efa 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1149,7 +1149,7 @@ write_class_details(ostream &out, Object *obj) { out << "static void *Dtool_UpcastInterface_" << ClassName << "(PyObject *self, Dtool_PyTypedObject *requested_type) {\n"; out << " Dtool_PyTypedObject *type = DtoolInstance_TYPE(self);\n"; out << " if (type != &Dtool_" << ClassName << ") {\n"; - out << " printf(\"" << ClassName << " ** Bad Source Type-- Requesting Conversion from %s to %s\\n\", Py_TYPE(self)->tp_name, requested_type->_PyType.tp_name); fflush(nullptr);\n";; + out << " printf(\"%s ** Bad Source Type-- Requesting Conversion from %s to %s\\n\", \"" << ClassName << "\", Py_TYPE(self)->tp_name, requested_type->_PyType.tp_name); fflush(nullptr);\n"; out << " return nullptr;\n"; out << " }\n"; out << "\n";