diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe8163..f860f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > breaking changes may be introduced > at any time without warning. +## [0.1.11] - 2024-06-10 + +### Changed + +- Raise a warning when the core's requested maximum framebuffer size + is larger than what the OpenGL implementation can provide. + ## [0.1.10] - 2024-06-07 ### Fixed diff --git a/src/libretro/drivers/video/opengl/moderngl.py b/src/libretro/drivers/video/opengl/moderngl.py index a4c88f0..bb4d98d 100644 --- a/src/libretro/drivers/video/opengl/moderngl.py +++ b/src/libretro/drivers/video/opengl/moderngl.py @@ -607,6 +607,16 @@ def __get_framebuffer_size(self) -> tuple[int, int]: max_rb_size = self._context.info["GL_MAX_RENDERBUFFER_SIZE"] geometry = self._system_av_info.geometry + if ( + geometry.max_width > max_rb_size + or geometry.max_height > max_fbo_size + or geometry.max_height > max_rb_size + or geometry.max_width > max_fbo_size + ): + warnings.warn( + f"Core-provided framebuffer size ({geometry.max_width}x{geometry.max_height}) exceeds GL_MAX_TEXTURE_SIZE ({max_fbo_size}) or GL_MAX_RENDERBUFFER_SIZE ({max_rb_size})" + ) + width = min(geometry.max_width, max_fbo_size, max_rb_size) height = min(geometry.max_height, max_fbo_size, max_rb_size) return width, height