Skip to content

Commit 601b439

Browse files
committed
Fix a bug where ModernGlVideoDriver would try to use OpenGL debugging features even if they weren't available.
1 parent 3ae8817 commit 601b439

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- Fixed a bug where logging invalid UTF-8 characters in `UnformattedLogDriver` would raise an exception.
1818
- Fixed a bug where fetching an unset option from a `DictOptionDriver` wouldn't register the default value for next time.
19+
- Fixed a bug where `ModernGlVideoDriver` would try to use OpenGL debugging features even if they weren't available.
1920

2021
## [0.1.2] - 2024-05-31
2122

src/libretro/drivers/video/opengl/moderngl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def reinit(self) -> None:
426426
)
427427
# TODO: Make the particular names configurable
428428

429-
if self._has_debug:
429+
if self._has_debug and GL.glObjectLabel:
430430
GL.glObjectLabel(
431431
GL.GL_PROGRAM, self._shader_program.glo, -1, b"libretro.py Shader Program"
432432
)
@@ -624,7 +624,7 @@ def __init_fbo(self):
624624
# Similar to glGenFramebuffers, glBindFramebuffer, and glFramebufferTexture2D
625625
self._fbo = self._context.framebuffer(self._color, self._depth)
626626

627-
if self._has_debug:
627+
if self._has_debug and GL.glObjectLabel:
628628
GL.glObjectLabel(
629629
GL.GL_TEXTURE, self._color.glo, -1, b"libretro.py Main FBO Color Attachment"
630630
)
@@ -667,7 +667,7 @@ def __init_hw_render(self):
667667
)
668668
self._hw_render_fbo.clear()
669669

670-
if self._has_debug:
670+
if self._has_debug and GL.glObjectLabel:
671671
GL.glObjectLabel(
672672
GL.GL_FRAMEBUFFER,
673673
self._hw_render_fbo.glo,
@@ -713,7 +713,7 @@ def __update_cpu_texture(self, data: memoryview, width: int, height: int, pitch:
713713
)
714714
# moderngl can't natively express GL_RGB5
715715

716-
if self._has_debug:
716+
if self._has_debug and GL.glObjectLabel:
717717
GL.glObjectLabel(
718718
GL.GL_TEXTURE, self._cpu_color.glo, -1, b"libretro.py CPU-Rendered Frame"
719719
)

0 commit comments

Comments
 (0)