diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 8 |
2 files changed, 17 insertions, 16 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 13e2a77ce..170548528 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <memory> | 6 | #include <memory> |
| 6 | #include <string> | 7 | #include <string> |
| 7 | #include <tuple> | 8 | #include <tuple> |
| @@ -290,18 +291,18 @@ void RasterizerOpenGL::DrawArrays() { | |||
| 290 | : (depth_surface == nullptr ? 1u : depth_surface->res_scale); | 291 | : (depth_surface == nullptr ? 1u : depth_surface->res_scale); |
| 291 | 292 | ||
| 292 | MathUtil::Rectangle<u32> draw_rect{ | 293 | MathUtil::Rectangle<u32> draw_rect{ |
| 293 | static_cast<u32>(MathUtil::Clamp<s32>(static_cast<s32>(surfaces_rect.left) + | 294 | static_cast<u32>( |
| 294 | viewport_rect.left * res_scale, | 295 | std::clamp<s32>(static_cast<s32>(surfaces_rect.left) + viewport_rect.left * res_scale, |
| 295 | surfaces_rect.left, surfaces_rect.right)), // Left | 296 | surfaces_rect.left, surfaces_rect.right)), // Left |
| 296 | static_cast<u32>(MathUtil::Clamp<s32>(static_cast<s32>(surfaces_rect.bottom) + | 297 | static_cast<u32>( |
| 297 | viewport_rect.top * res_scale, | 298 | std::clamp<s32>(static_cast<s32>(surfaces_rect.bottom) + viewport_rect.top * res_scale, |
| 298 | surfaces_rect.bottom, surfaces_rect.top)), // Top | 299 | surfaces_rect.bottom, surfaces_rect.top)), // Top |
| 299 | static_cast<u32>(MathUtil::Clamp<s32>(static_cast<s32>(surfaces_rect.left) + | 300 | static_cast<u32>( |
| 300 | viewport_rect.right * res_scale, | 301 | std::clamp<s32>(static_cast<s32>(surfaces_rect.left) + viewport_rect.right * res_scale, |
| 301 | surfaces_rect.left, surfaces_rect.right)), // Right | 302 | surfaces_rect.left, surfaces_rect.right)), // Right |
| 302 | static_cast<u32>(MathUtil::Clamp<s32>(static_cast<s32>(surfaces_rect.bottom) + | 303 | static_cast<u32>(std::clamp<s32>(static_cast<s32>(surfaces_rect.bottom) + |
| 303 | viewport_rect.bottom * res_scale, | 304 | viewport_rect.bottom * res_scale, |
| 304 | surfaces_rect.bottom, surfaces_rect.top))}; // Bottom | 305 | surfaces_rect.bottom, surfaces_rect.top))}; // Bottom |
| 305 | 306 | ||
| 306 | // Bind the framebuffer surfaces | 307 | // Bind the framebuffer surfaces |
| 307 | BindFramebufferSurfaces(color_surface, depth_surface, has_stencil); | 308 | BindFramebufferSurfaces(color_surface, depth_surface, has_stencil); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 561c6913d..6c1c6775a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -1086,10 +1086,10 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces( | |||
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | MathUtil::Rectangle<u32> viewport_clamped{ | 1088 | MathUtil::Rectangle<u32> viewport_clamped{ |
| 1089 | static_cast<u32>(MathUtil::Clamp(viewport.left, 0, static_cast<s32>(config.width))), | 1089 | static_cast<u32>(std::clamp(viewport.left, 0, static_cast<s32>(config.width))), |
| 1090 | static_cast<u32>(MathUtil::Clamp(viewport.top, 0, static_cast<s32>(config.height))), | 1090 | static_cast<u32>(std::clamp(viewport.top, 0, static_cast<s32>(config.height))), |
| 1091 | static_cast<u32>(MathUtil::Clamp(viewport.right, 0, static_cast<s32>(config.width))), | 1091 | static_cast<u32>(std::clamp(viewport.right, 0, static_cast<s32>(config.width))), |
| 1092 | static_cast<u32>(MathUtil::Clamp(viewport.bottom, 0, static_cast<s32>(config.height)))}; | 1092 | static_cast<u32>(std::clamp(viewport.bottom, 0, static_cast<s32>(config.height)))}; |
| 1093 | 1093 | ||
| 1094 | // get color and depth surfaces | 1094 | // get color and depth surfaces |
| 1095 | SurfaceParams color_params; | 1095 | SurfaceParams color_params; |