diff options
| author | 2017-05-28 01:01:00 -0700 | |
|---|---|---|
| committer | 2017-05-28 01:01:00 -0700 | |
| commit | 4caa2bad9d57c97aa749d3a44f6be6f593bb798b (patch) | |
| tree | ba001a9832ee8965963d17fd4e93e9222e1153de /src/video_core | |
| parent | Merge pull request #2732 from yuriks/add-fmt (diff) | |
| parent | CMake: Correct inter-module dependencies and library visibility (diff) | |
| download | yuzu-4caa2bad9d57c97aa749d3a44f6be6f593bb798b.tar.gz yuzu-4caa2bad9d57c97aa749d3a44f6be6f593bb798b.tar.xz yuzu-4caa2bad9d57c97aa749d3a44f6be6f593bb798b.zip | |
Merge pull request #2733 from yuriks/cmake-cleanup
Dependencies and build system cleanup
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 20 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 3 | ||||
| -rw-r--r-- | src/video_core/video_core.h | 15 |
5 files changed, 17 insertions, 43 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index e00b88f71..e455f03bd 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -79,13 +79,15 @@ endif() | |||
| 79 | create_directory_groups(${SRCS} ${HEADERS}) | 79 | create_directory_groups(${SRCS} ${HEADERS}) |
| 80 | 80 | ||
| 81 | add_library(video_core STATIC ${SRCS} ${HEADERS}) | 81 | add_library(video_core STATIC ${SRCS} ${HEADERS}) |
| 82 | target_link_libraries(video_core glad) | 82 | target_link_libraries(video_core PUBLIC common core) |
| 83 | target_link_libraries(video_core PRIVATE glad) | ||
| 84 | |||
| 83 | if (ARCHITECTURE_x86_64) | 85 | if (ARCHITECTURE_x86_64) |
| 84 | target_link_libraries(video_core xbyak) | 86 | target_link_libraries(video_core PRIVATE xbyak) |
| 85 | endif() | 87 | endif() |
| 86 | 88 | ||
| 87 | if (PNG_FOUND) | 89 | if (PNG_FOUND) |
| 88 | target_link_libraries(video_core ${PNG_LIBRARIES}) | 90 | target_link_libraries(video_core PRIVATE ${PNG_LIBRARIES}) |
| 89 | include_directories(${PNG_INCLUDE_DIRS}) | 91 | target_include_directories(video_core PRIVATE ${PNG_INCLUDE_DIRS}) |
| 90 | add_definitions(${PNG_DEFINITIONS}) | 92 | target_compile_definitions(video_core PRIVATE ${PNG_DEFINITIONS}) |
| 91 | endif() | 93 | endif() |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 456443e86..8b717e43d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -561,20 +561,16 @@ RasterizerCacheOpenGL::GetFramebufferSurfaces( | |||
| 561 | color_params.is_tiled = depth_params.is_tiled = true; | 561 | color_params.is_tiled = depth_params.is_tiled = true; |
| 562 | 562 | ||
| 563 | // Set the internal resolution, assume the same scaling factor for top and bottom screens | 563 | // Set the internal resolution, assume the same scaling factor for top and bottom screens |
| 564 | const Layout::FramebufferLayout& layout = VideoCore::g_emu_window->GetFramebufferLayout(); | 564 | float resolution_scale_factor = Settings::values.resolution_factor; |
| 565 | if (Settings::values.resolution_factor == 0.0f) { | 565 | if (resolution_scale_factor == 0.0f) { |
| 566 | // Auto - scale resolution to the window size | 566 | // Auto - scale resolution to the window size |
| 567 | color_params.res_scale_width = depth_params.res_scale_width = | 567 | resolution_scale_factor = VideoCore::g_emu_window->GetFramebufferLayout().GetScalingRatio(); |
| 568 | (float)layout.top_screen.GetWidth() / VideoCore::kScreenTopWidth; | ||
| 569 | color_params.res_scale_height = depth_params.res_scale_height = | ||
| 570 | (float)layout.top_screen.GetHeight() / VideoCore::kScreenTopHeight; | ||
| 571 | } else { | ||
| 572 | // Otherwise, scale the resolution by the specified factor | ||
| 573 | color_params.res_scale_width = Settings::values.resolution_factor; | ||
| 574 | depth_params.res_scale_width = Settings::values.resolution_factor; | ||
| 575 | color_params.res_scale_height = Settings::values.resolution_factor; | ||
| 576 | depth_params.res_scale_height = Settings::values.resolution_factor; | ||
| 577 | } | 568 | } |
| 569 | // Scale the resolution by the specified factor | ||
| 570 | color_params.res_scale_width = resolution_scale_factor; | ||
| 571 | depth_params.res_scale_width = resolution_scale_factor; | ||
| 572 | color_params.res_scale_height = resolution_scale_factor; | ||
| 573 | depth_params.res_scale_height = resolution_scale_factor; | ||
| 578 | 574 | ||
| 579 | color_params.addr = config.GetColorBufferPhysicalAddress(); | 575 | color_params.addr = config.GetColorBufferPhysicalAddress(); |
| 580 | color_params.pixel_format = CachedSurface::PixelFormatFromColorFormat(config.color_format); | 576 | color_params.pixel_format = CachedSurface::PixelFormatFromColorFormat(config.color_format); |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index e19375466..d90c776f9 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -94,14 +94,8 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons | |||
| 94 | return matrix; | 94 | return matrix; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | /// RendererOpenGL constructor | 97 | RendererOpenGL::RendererOpenGL() = default; |
| 98 | RendererOpenGL::RendererOpenGL() { | 98 | RendererOpenGL::~RendererOpenGL() = default; |
| 99 | resolution_width = std::max(VideoCore::kScreenTopWidth, VideoCore::kScreenBottomWidth); | ||
| 100 | resolution_height = VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight; | ||
| 101 | } | ||
| 102 | |||
| 103 | /// RendererOpenGL destructor | ||
| 104 | RendererOpenGL::~RendererOpenGL() {} | ||
| 105 | 99 | ||
| 106 | /// Swap buffers (render frame) | 100 | /// Swap buffers (render frame) |
| 107 | void RendererOpenGL::SwapBuffers() { | 101 | void RendererOpenGL::SwapBuffers() { |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 87c556cff..0b4f69e8f 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h | |||
| @@ -68,9 +68,6 @@ private: | |||
| 68 | 68 | ||
| 69 | EmuWindow* render_window; ///< Handle to render window | 69 | EmuWindow* render_window; ///< Handle to render window |
| 70 | 70 | ||
| 71 | int resolution_width; ///< Current resolution width | ||
| 72 | int resolution_height; ///< Current resolution height | ||
| 73 | |||
| 74 | OpenGLState state; | 71 | OpenGLState state; |
| 75 | 72 | ||
| 76 | // OpenGL object IDs | 73 | // OpenGL object IDs |
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index 4aba19ca0..94e0867f0 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h | |||
| @@ -15,21 +15,6 @@ class RendererBase; | |||
| 15 | 15 | ||
| 16 | namespace VideoCore { | 16 | namespace VideoCore { |
| 17 | 17 | ||
| 18 | // 3DS Video Constants | ||
| 19 | // ------------------- | ||
| 20 | |||
| 21 | // NOTE: The LCDs actually rotate the image 90 degrees when displaying. Because of that the | ||
| 22 | // framebuffers in video memory are stored in column-major order and rendered sideways, causing | ||
| 23 | // the widths and heights of the framebuffers read by the LCD to be switched compared to the | ||
| 24 | // heights and widths of the screens listed here. | ||
| 25 | static const int kScreenTopWidth = 400; ///< 3DS top screen width | ||
| 26 | static const int kScreenTopHeight = 240; ///< 3DS top screen height | ||
| 27 | static const int kScreenBottomWidth = 320; ///< 3DS bottom screen width | ||
| 28 | static const int kScreenBottomHeight = 240; ///< 3DS bottom screen height | ||
| 29 | |||
| 30 | // Video core renderer | ||
| 31 | // --------------------- | ||
| 32 | |||
| 33 | extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin | 18 | extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin |
| 34 | extern EmuWindow* g_emu_window; ///< Emu window | 19 | extern EmuWindow* g_emu_window; ///< Emu window |
| 35 | 20 | ||