From 68c807bd5d42a3bb796cb890c599e2b2d141e0ad Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 28 Jan 2026 16:51:33 +0100 Subject: [PATCH] glgsg: Don't query supported Cg profiles when running under EGL Cg tries to dlopen libGL and load and call GLX functions from there, which is not good --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 1550d51829..f534aec9bb 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3998,8 +3998,8 @@ reset() { } _auto_detect_shader_model = _shader_model; - if (GLCAT.is_debug()) { #ifdef HAVE_CG + if (GLCAT.is_debug() && may_support_cg_shaders()) { #if CG_VERSION_NUM >= 2200 GLCAT.debug() << "Supported Cg profiles:\n"; int num_profiles = cgGetNumSupportedProfiles(); @@ -4037,8 +4037,10 @@ reset() { GLCAT.debug() << "Cg active geometry profile = " << cgGetProfileString((CGprofile)_shader_caps._active_gprofile) << "\n"; + } #endif // HAVE_CG + if (GLCAT.is_debug()) { GLCAT.debug() << "shader model = " << _shader_model << "\n"; } #endif // !OPENGLES