diff --git a/CHANGELOG.md b/CHANGELOG.md index 29ada20..238c17b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where logging invalid UTF-8 characters in `UnformattedLogDriver` would raise an exception. - Fixed a bug where fetching an unset option from a `DictOptionDriver` wouldn't register the default value for next time. +- Fixed a bug where `ModernGlVideoDriver` would try to use OpenGL debugging features even if they weren't available. ## [0.1.2] - 2024-05-31 diff --git a/src/libretro/drivers/video/opengl/moderngl.py b/src/libretro/drivers/video/opengl/moderngl.py index 78abfc2..e20fb0d 100644 --- a/src/libretro/drivers/video/opengl/moderngl.py +++ b/src/libretro/drivers/video/opengl/moderngl.py @@ -426,7 +426,7 @@ def reinit(self) -> None: ) # TODO: Make the particular names configurable - if self._has_debug: + if self._has_debug and GL.glObjectLabel: GL.glObjectLabel( GL.GL_PROGRAM, self._shader_program.glo, -1, b"libretro.py Shader Program" ) @@ -624,7 +624,7 @@ def __init_fbo(self): # Similar to glGenFramebuffers, glBindFramebuffer, and glFramebufferTexture2D self._fbo = self._context.framebuffer(self._color, self._depth) - if self._has_debug: + if self._has_debug and GL.glObjectLabel: GL.glObjectLabel( GL.GL_TEXTURE, self._color.glo, -1, b"libretro.py Main FBO Color Attachment" ) @@ -667,7 +667,7 @@ def __init_hw_render(self): ) self._hw_render_fbo.clear() - if self._has_debug: + if self._has_debug and GL.glObjectLabel: GL.glObjectLabel( GL.GL_FRAMEBUFFER, self._hw_render_fbo.glo, @@ -713,7 +713,7 @@ def __update_cpu_texture(self, data: memoryview, width: int, height: int, pitch: ) # moderngl can't natively express GL_RGB5 - if self._has_debug: + if self._has_debug and GL.glObjectLabel: GL.glObjectLabel( GL.GL_TEXTURE, self._cpu_color.glo, -1, b"libretro.py CPU-Rendered Frame" )