Skip to content

Commit

Permalink
Fix a bug where ModernGlVideoDriver would try to use OpenGL debuggi…
Browse files Browse the repository at this point in the history
…ng features even if they weren't available.
  • Loading branch information
JesseTG committed Jun 2, 2024
1 parent 3ae8817 commit 601b439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/libretro/drivers/video/opengl/moderngl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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"
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"
)
Expand Down

0 comments on commit 601b439

Please sign in to comment.