diff options
| author | 2021-10-12 00:35:01 -0400 | |
|---|---|---|
| committer | 2021-11-16 22:11:31 +0100 | |
| commit | abd07e41582b6d8f7efdedb936cdd7a7fddf9912 (patch) | |
| tree | 4b1b3c2a676abc935517b669566068270029b6d3 /src/video_core/renderer_opengl | |
| parent | texture_cache: Fix image resolves when src/dst are not both scaled (diff) | |
| download | yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.gz yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.xz yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.zip | |
video_core: Refactor resolution scale function
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 3dfd13d6a..ec1afd31a 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -924,12 +924,8 @@ bool Image::Scale() { | |||
| 924 | const GLenum filter = linear_color_format ? GL_LINEAR : GL_NEAREST; | 924 | const GLenum filter = linear_color_format ? GL_LINEAR : GL_NEAREST; |
| 925 | 925 | ||
| 926 | const auto& resolution = runtime->resolution; | 926 | const auto& resolution = runtime->resolution; |
| 927 | const u32 up = resolution.up_scale; | 927 | const u32 scaled_width = resolution.ScaleUp(info.size.width); |
| 928 | const u32 down = resolution.down_shift; | 928 | const u32 scaled_height = is_2d ? resolution.ScaleUp(info.size.height) : info.size.height; |
| 929 | const auto scale = [&](u32 value) { return std::max<u32>((value * up) >> down, 1U); }; | ||
| 930 | |||
| 931 | const u32 scaled_width = scale(info.size.width); | ||
| 932 | const u32 scaled_height = is_2d ? scale(info.size.height) : info.size.height; | ||
| 933 | const u32 original_width = info.size.width; | 929 | const u32 original_width = info.size.width; |
| 934 | const u32 original_height = info.size.height; | 930 | const u32 original_height = info.size.height; |
| 935 | 931 | ||