Better detection of not supported gl version?

The driver of the graphic card of my Window machine supports OpenGL up to 4.2. If I require a higher version of OpenGL, using “gl-version 4 5” for example, the GSG throws a lot of errors then it is disabled. But nowhere in the log there is information saying that the open gl version is not supported, could it be detected and the program aborted gracefully with an error message ?

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): at 3272 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): at 3305 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:audio(error):   load_dso(libp3openal_audio.so) failed, will use NullAudioManager
:audio(error):     Path not found
:display:gsg:glgsg(error): at 823 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsBuffer_src.cxx : invalid operation
:display:gsg:glgsg(error): at 823 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsBuffer_src.cxx : invalid operation
:display:gsg:glgsg(error): at 3870 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 7249 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
Vertex shader was successfully compiled to run on hardware.
Fragment shader was successfully compiled to run on hardware.
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
Vertex shader(s) linked, fragment shader(s) linked.

:display:gsg:glgsg(error): at 7470 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 7514 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): at 11870 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): at 12178 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): at 7787 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 7638 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): at 4620 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 7249 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
Vertex shader was successfully compiled to run on hardware.
Fragment shader was successfully compiled to run on hardware.
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
Vertex shader(s) linked, fragment shader(s) linked.

:display:gsg:glgsg(error): at 7514 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): at 12178 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): at 7787 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 11328 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): at 3870 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): at 7249 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
Vertex shader was successfully compiled to run on hardware.
Fragment shader was successfully compiled to run on hardware.
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
Vertex shader(s) linked, fragment shader(s) linked.

:display:gsg:glgsg(error): at 7470 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display(error): Deactivating wglGraphicsStateGuardian.
1 Like

I would also find in very useful to detect the supported open gl version. Mac for example hates on glsl 130 and needs at least 150, and some (older?) linux drivers work fine with 130 and refuse to run on 150. It would be very useful to detect the supported version and change the shaders to fit (glsl 130 and 150 shaders are almost identical, save for the number on top).

This looks like a driver bug, but could you supply output with these settings enabled?

gl-debug true
notify-level-glgsg debug

The problem clearly occurs if I require OpenGL 4.1 or greater using following config line :

gl-version 4 1

Requesting OpenGL 3.2 works fine. And, according to the log below, it seems that me or Panda is using deprecated function that has been removed from OpenGL Core 4 and above.

Now the question is : do I need to require a specific version of open gl ? I started to do it as on MacOS it’s mandatory to get a decent version of OpenGL, but is it needed on Linux or Windows or could I just expect the latest version of OpenGL and check at runtimes which features are available ?

The debug log is (With gl extensions removed as I can’t make post bigger than 32K characters) :

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_pixel_format 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_multisample 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_create_context 1
:display:gsg:glgsg(debug): GL_VENDOR = ATI Technologies Inc.
:display:gsg:glgsg(debug): GL_RENDERER = AMD Radeon HD 7300 Series Graphics
:display:gsg:glgsg(debug): GL_VERSION = 4.1.11566 Core Profile/Debug Context
:display:gsg:glgsg(debug): Detected OpenGL version: 4.1
:display:gsg:glgsg(debug): GL_SHADING_LANGUAGE_VERSION = 4.20
:display:gsg:glgsg(debug): Detected GLSL version: 4.20
:display:gsg:glgsg(debug): HAS EXT GL_ARB_compatibility 1
:display:gsg:glgsg(debug): Using compatibility profile
:display:gsg:glgsg(debug): GL Extensions:

<removed from post>

:display:gsg:glgsg(debug): HAS EXT GL_EXT_debug_marker 0
:display:gsg:glgsg(debug): HAS EXT GL_KHR_debug 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_debug_output 1
:display:gsg:glgsg: gl-debug enabled.
:display:gsg:glgsg(debug): HAS EXT GL_ARB_ES3_compatibility 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_storage 1
:display:gsg:glgsg(debug): HAS EXT GL_ARB_clear_texture 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_clear_buffer_object 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_vertex_type_10f_11f_11f_rev 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_buffer_storage 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_vertex_program 1
:display:gsg:glgsg(debug): HAS EXT GL_ARB_fragment_program 1
:display:gsg:glgsg(debug): HAS EXT GL_NV_gpu_program5 0
:display:gsg:glgsg(debug): HAS EXT GL_NV_gpu_program4 0
:display:gsg:glgsg(debug): HAS EXT GL_NV_vertex_program3 0
:display:gsg:glgsg(debug): HAS EXT GL_NV_vertex_program2 0
:display:gsg:glgsg(debug): HAS EXT GL_NV_vertex_program1_1 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_compute_shader 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_vertex_attrib_binding 0
:display:gsg:glgsg(debug): HAS EXT ARB_shader_storage_buffer_object 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_direct_state_access 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_framebuffer_no_attachments 0
:display:gsg:glgsg(debug): HAS EXT GL_NV_framebuffer_multisample_coverage 0
:display:gsg:glgsg(debug): Occlusion query counter provides 32 bits.
:display:gsg:glgsg(debug): HAS EXT GL_EXT_texture_mirror_clamp 1
:display:gsg:glgsg(debug): max texture dimension = 16384, max 3d texture = 8192, max 2d texture array = 8192, max cube map = 16384
:display:gsg:glgsg(debug): max_elements_vertices = 2147483647, max_elements_indices = 16777215
:display:gsg:glgsg(debug): vertex buffer objects are supported.
:display:gsg:glgsg(debug): Supported compressed texture formats:
  Unknown compressed format 0x84ed
  Unknown compressed format 0x84ee
  GL_COMPRESSED_RGB_S3TC_DXT1_EXT
  GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
  GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
  GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
  Unknown compressed format 0x83a0
  Unknown compressed format 0x83a1
  Unknown compressed format 0x83a2
  Unknown compressed format 0x83a3
  GL_COMPRESSED_SRGB_EXT
  GL_COMPRESSED_SRGB_ALPHA_EXT
  GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
  GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
  GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
  GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
  GL_COMPRESSED_RGBA_BPTC_UNORM
  GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM
  GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT
  GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
:display:gsg:glgsg(debug): HAS EXT GL_EXT_texture_filter_anisotropic 1
:display:gsg:glgsg(debug): HAS EXT GL_ARB_shader_image_load_store 1
:display:gsg:glgsg(debug): HAS EXT GL_ARB_multi_bind 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_internalformat_query2 0
:display:gsg:glgsg(debug): HAS EXT GL_ARB_bindless_texture 0
:display:gsg:glgsg(error): at 3073 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): Using glGetIntegerv in a Core context with parameter <pname> and enum '0xd57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(debug): HAS EXT GL_EXT_stencil_two_side 0
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xb10' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glGetIntegerv in a Core context with parameter <pname> and enum '0xd31' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(debug): max lights = 0
:display:gsg:glgsg(debug): max clip planes = 8
:display:gsg:glgsg(error): Using glGetIntegerv in a Core context with parameter <pname> and enum '0x84e2' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(debug): max texture stages = 0
:display:gsg:glgsg(error): at 3272 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): Using glHint in a Core context with parameter <target> and enum '0xc54' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glGetIntegerv in a Core context with parameter <pname> and enum '0xd52' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(debug): frame buffer depth = 0 bits/channel, enabling dithering
:display:gsg:glgsg(error): at 3305 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(debug): Supported program binary formats:
:display:gsg:glgsg(debug):   0x901E
:display:gsg:glgsg(debug): Supported Cg profiles:
:display:gsg:glgsg(error): Using glGetString in a Core context with parameter <name> and enum '0x1f03' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(debug):   arbvp1
:display:gsg:glgsg(debug):   arbfp1
:display:gsg:glgsg(debug):   glslv
:display:gsg:glgsg(debug):   glslf
:display:gsg:glgsg(debug):   glslg
:display:gsg:glgsg(debug): Cg GLSL version = CG_GL_GLSL_120
:display:gsg:glgsg(debug): Cg latest vertex profile = arbvp1
:display:gsg:glgsg(debug): Cg latest fragment profile = arbfp1
:display:gsg:glgsg(debug): Cg latest geometry profile = unknown
:display:gsg:glgsg(debug): basic-shaders-only #f
:display:gsg:glgsg(debug): Cg active vertex profile = glslv
:display:gsg:glgsg(debug): Cg active fragment profile = glslf
:display:gsg:glgsg(debug): Cg active geometry profile = glslg
:display:gsg:glgsg(debug): shader model = 5.0
:display:gsg:glgsg(debug): HAS EXT WGL_EXT_swap_control 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_pbuffer 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_pixel_format 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_multisample 1
:display:gsg:glgsg(debug): HAS EXT WGL_ARB_render_texture 1
:display:gsg:glgsg(error): at 303 of c:\buildslave\sdk-windows-amd64\build\panda\src\wgldisplay\wglGraphicsWindow.cxx : invalid enumerant
:audio(error):   load_dso(libp3openal_audio.so) failed, will use NullAudioManager
:audio(error):     Path not found
:display:gsg:glgsg(error): glAlphaFunc has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xbc0' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 7470 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xba1' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0x803a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 7514 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): glShadeModel has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 11624 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColorMaterial has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7787 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): glMatrixMode has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLoadMatrixf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 3870 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): glMatrixMode has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLoadMatrixf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7249 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(debug): Compiling GLSL vertex shader created-shader
Vertex shader was successfully compiled to run on hardware.
:display:gsg:glgsg(debug): Compiling GLSL fragment shader created-shader
Fragment shader was successfully compiled to run on hardware.
:display:gsg:glgsg(debug): Linking GLSL shader created-shader
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
Vertex shader(s) linked, fragment shader(s) linked.

:display:gsg:glgsg(debug): Active attribute p3d_Color with size 1 and type 0x8b52 is bound to location 3
:display:gsg:glgsg(debug): Active attribute p3d_MultiTexCoord0 with size 1 and type 0x8b52 is bound to location 1
:display:gsg:glgsg(debug): Active attribute p3d_Vertex with size 1 and type 0x8b52 is bound to location 0
:display:gsg:glgsg(debug): Active attribute size with size 1 and type 0x1406 is bound to location 2
:display:gsg:glgsg(debug): Active uniform p3d_ColorScale with size 1 and type 0x8b52 is bound to location 0
:display:gsg:glgsg(debug): Active uniform p3d_ModelViewMatrix with size 1 and type 0x8b5c is bound to location 1
:display:gsg:glgsg(debug): Active uniform p3d_ProjectionMatrix with size 1 and type 0x8b5c is bound to location 2
:display:gsg:glgsg(debug): Active uniform size_scale with size 1 and type 0x1406 is bound to location 3
:display:gsg:glgsg(debug): Active uniform transparency_level with size 1 and type 0x1406 is bound to location 4
:display:gsg:glgsg(debug): Active uniform p3d_Texture0 with size 1 and type 0x8b5e is bound to location 5
:display:gsg:glgsg(error): glAlphaFunc has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7618 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0x803a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xba1' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 7514 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(debug): loading uncompressed texture 
:display:gsg:glgsg(debug): loading new texture object for , 64 x 64 x 1, z = 0, mipmaps 1, uses_mipmaps = 1
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(debug): generating mipmaps for texture , 64 x 64 x 1, uses_mipmaps = 1
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0x8861' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 12178 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColorMaterial has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7787 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb50' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModelfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 11328 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): glDisableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glDisableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColor4f has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glDisableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 4620 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): glMatrixMode has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLoadMatrixf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7249 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(debug): Compiling GLSL vertex shader created-shader
Vertex shader was successfully compiled to run on hardware.
:display:gsg:glgsg(debug): Compiling GLSL fragment shader created-shader
Fragment shader was successfully compiled to run on hardware.
:display:gsg:glgsg(debug): Linking GLSL shader created-shader
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
Vertex shader(s) linked, fragment shader(s) linked.

:display:gsg:glgsg(debug): Active attribute p3d_Color with size 1 and type 0x8b52 is bound to location 3
:display:gsg:glgsg(debug): Active attribute p3d_MultiTexCoord0 with size 1 and type 0x8b52 is bound to location 1
:display:gsg:glgsg(debug): Active attribute p3d_Vertex with size 1 and type 0x8b52 is bound to location 0
:display:gsg:glgsg(debug): Active uniform p3d_ColorScale with size 1 and type 0x8b52 is bound to location 0
:display:gsg:glgsg(debug): Active uniform p3d_ModelViewMatrix with size 1 and type 0x8b5c is bound to location 1
:display:gsg:glgsg(debug): Active uniform p3d_ProjectionMatrix with size 1 and type 0x8b5c is bound to location 2
:display:gsg:glgsg(debug): Active uniform transparency_level with size 1 and type 0x1406 is bound to location 3
:display:gsg:glgsg(debug): Active uniform p3d_Texture0 with size 1 and type 0x8b5e is bound to location 4
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xba1' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0x803a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 7514 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(debug): loading uncompressed texture 
:display:gsg:glgsg(debug): loading new texture object for , 256 x 256 x 1, z = 0, mipmaps 1, uses_mipmaps = 0
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0x8861' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): at 12178 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid enumerant
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColorMaterial has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7787 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): glLightModelfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 11328 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(debug): loading uncompressed texture 
:display:gsg:glgsg(debug): loading new texture object for , 16 x 16 x 1, z = 0, mipmaps 1, uses_mipmaps = 0
:display:gsg:glgsg(error): Using glTexImage2D in a Core context with parameter <format> and enum '0x190a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): GL texture creation failed for  : invalid enumerant
:display:gsg:glgsg(error): Could not load 
:display:gsg:glgsg(error): glAlphaFunc has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): at 7470 of c:\buildslave\sdk-windows-amd64\build\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xba1' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0x803a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display(error): Deactivating wglGraphicsStateGuardian.
:display:gsg:glgsg(error): glShadeModel has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColorMaterial has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xb50' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glMatrixMode has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLoadMatrixf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMatrixMode has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLoadMatrixf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glAlphaFunc has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xba1' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0x803a' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialf has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glDisable in a Core context with parameter <cap> and enum '0xb57' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glMaterialfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glLightModeli has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): Using glEnable in a Core context with parameter <cap> and enum '0xb50' which was removed from Core OpenGL (GL_INVALID_ENUM)
:display:gsg:glgsg(error): glLightModelfv has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glDisableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glDisableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glColor4f has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glVertexPointer has been removed from OpenGL Core context (GL_INVALID_OPERATION)
:display:gsg:glgsg(error): glEnableClientState has been removed from OpenGL Core context (GL_INVALID_OPERATION)

Yeah, it’s a driver bug, because it’s reporting support for GL_ARB_compatibility in a core profile. Panda would not be using that deprecated function if the driver didn’t say that Panda was allowed to use it.

gl-version 3 2 should be sufficient to get a forward-compatible context. It is needed on some drivers (macOS, but also Mesa on Linux) to be able to get a 3.2+ context at all. It is not sufficient in those cases to rely on runtime detection.

I ended up doing this in my game:


Perhaps we can add a gl-prefer-core-profile variable or something of the sort that does the right thing and automatically falls back to a compatibility profile if the context has issues.

That would be nice, in the mean time I’ll be using your workaround, it is not too disruptive after all.

I had time to test on that windows host, and sadly the workaround does not work. The method open_default_window() does not report an error nor throws an exception, yet the GSG is deactivated so I end up with a black window as the workaround is not triggered.

Is it possible to detect is the GSG is deactivated ? at least I could check from another task and close the application and print a message in the log.

Please file a GitHub issue for having better detection of an invalid OpenGL context. Panda should be able to catch this by checking if some basic OpenGL calls fail.

Just checking gsg.active should tell you whether it’s active or not. You can also catch the panic-deactivate-gsg event.

Done here : opengl: Better detection of an invalid OpenGL context · Issue #643 · panda3d/panda3d · GitHub

I overlooked that property, but the event is much better as I don’t have to poll the active flag

I found out there’s a better way to check whether OpenGL context is core or compat. Will check this in shortly.