diff options
| author | 2016-12-29 23:28:27 -0500 | |
|---|---|---|
| committer | 2017-01-07 03:23:22 -0500 | |
| commit | 22ad9094e6355e84f2e45abcd66748b2c74dfaf9 (patch) | |
| tree | 1124bc25253f2c4f6adc7ec9a90aa9a3d2213ba6 /src/video_core | |
| parent | Merge pull request #2410 from Subv/sleepthread (diff) | |
| download | yuzu-22ad9094e6355e84f2e45abcd66748b2c74dfaf9.tar.gz yuzu-22ad9094e6355e84f2e45abcd66748b2c74dfaf9.tar.xz yuzu-22ad9094e6355e84f2e45abcd66748b2c74dfaf9.zip | |
config: Add option for specifying screen resolution scale factor.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/video_core.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/video_core.h | 1 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 85aa06cd5..ef3b06a7b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -556,14 +556,21 @@ RasterizerCacheOpenGL::GetFramebufferSurfaces(const Pica::Regs::FramebufferConfi | |||
| 556 | color_params.width = depth_params.width = config.GetWidth(); | 556 | color_params.width = depth_params.width = config.GetWidth(); |
| 557 | color_params.height = depth_params.height = config.GetHeight(); | 557 | color_params.height = depth_params.height = config.GetHeight(); |
| 558 | color_params.is_tiled = depth_params.is_tiled = true; | 558 | color_params.is_tiled = depth_params.is_tiled = true; |
| 559 | if (VideoCore::g_scaled_resolution_enabled) { | ||
| 560 | auto layout = VideoCore::g_emu_window->GetFramebufferLayout(); | ||
| 561 | 559 | ||
| 562 | // Assume same scaling factor for top and bottom screens | 560 | // Set the internal resolution, assume the same scaling factor for top and bottom screens |
| 561 | const Layout::FramebufferLayout& layout = VideoCore::g_emu_window->GetFramebufferLayout(); | ||
| 562 | if (Settings::values.resolution_factor == 0.0f) { | ||
| 563 | // Auto - scale resolution to the window size | ||
| 563 | color_params.res_scale_width = depth_params.res_scale_width = | 564 | color_params.res_scale_width = depth_params.res_scale_width = |
| 564 | (float)layout.top_screen.GetWidth() / VideoCore::kScreenTopWidth; | 565 | (float)layout.top_screen.GetWidth() / VideoCore::kScreenTopWidth; |
| 565 | color_params.res_scale_height = depth_params.res_scale_height = | 566 | color_params.res_scale_height = depth_params.res_scale_height = |
| 566 | (float)layout.top_screen.GetHeight() / VideoCore::kScreenTopHeight; | 567 | (float)layout.top_screen.GetHeight() / VideoCore::kScreenTopHeight; |
| 568 | } else { | ||
| 569 | // Otherwise, scale the resolution by the specified factor | ||
| 570 | color_params.res_scale_width = Settings::values.resolution_factor; | ||
| 571 | depth_params.res_scale_width = Settings::values.resolution_factor; | ||
| 572 | color_params.res_scale_height = Settings::values.resolution_factor; | ||
| 573 | depth_params.res_scale_height = Settings::values.resolution_factor; | ||
| 567 | } | 574 | } |
| 568 | 575 | ||
| 569 | color_params.addr = config.GetColorBufferPhysicalAddress(); | 576 | color_params.addr = config.GetColorBufferPhysicalAddress(); |
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 8db882f59..7186a7652 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp | |||
| @@ -19,7 +19,6 @@ std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin | |||
| 19 | 19 | ||
| 20 | std::atomic<bool> g_hw_renderer_enabled; | 20 | std::atomic<bool> g_hw_renderer_enabled; |
| 21 | std::atomic<bool> g_shader_jit_enabled; | 21 | std::atomic<bool> g_shader_jit_enabled; |
| 22 | std::atomic<bool> g_scaled_resolution_enabled; | ||
| 23 | std::atomic<bool> g_vsync_enabled; | 22 | std::atomic<bool> g_vsync_enabled; |
| 24 | std::atomic<bool> g_toggle_framelimit_enabled; | 23 | std::atomic<bool> g_toggle_framelimit_enabled; |
| 25 | 24 | ||
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index c397c1974..4aba19ca0 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h | |||
| @@ -37,7 +37,6 @@ extern EmuWindow* g_emu_window; ///< Emu window | |||
| 37 | // qt ui) | 37 | // qt ui) |
| 38 | extern std::atomic<bool> g_hw_renderer_enabled; | 38 | extern std::atomic<bool> g_hw_renderer_enabled; |
| 39 | extern std::atomic<bool> g_shader_jit_enabled; | 39 | extern std::atomic<bool> g_shader_jit_enabled; |
| 40 | extern std::atomic<bool> g_scaled_resolution_enabled; | ||
| 41 | extern std::atomic<bool> g_toggle_framelimit_enabled; | 40 | extern std::atomic<bool> g_toggle_framelimit_enabled; |
| 42 | 41 | ||
| 43 | /// Start the video core | 42 | /// Start the video core |