diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.cpp | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 64bb753e6..d574e4b79 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -185,8 +185,9 @@ create_target_directory_groups(common) | |||
| 185 | 185 | ||
| 186 | target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) | 186 | target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) |
| 187 | target_link_libraries(common PRIVATE lz4::lz4 xbyak) | 187 | target_link_libraries(common PRIVATE lz4::lz4 xbyak) |
| 188 | if (MSVC) | 188 | if (TARGET zstd::zstd) |
| 189 | target_link_libraries(common PRIVATE zstd::zstd) | 189 | target_link_libraries(common PRIVATE zstd::zstd) |
| 190 | else() | 190 | else() |
| 191 | target_link_libraries(common PRIVATE zstd) | 191 | target_link_libraries(common PRIVATE |
| 192 | $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>) | ||
| 192 | endif() | 193 | endif() |
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 1ec8392e1..4a1d96322 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp | |||
| @@ -87,8 +87,12 @@ u32 GetBytesPerPixel(const Tegra::FramebufferConfig& framebuffer) { | |||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | std::size_t GetSizeInBytes(const Tegra::FramebufferConfig& framebuffer) { | 89 | std::size_t GetSizeInBytes(const Tegra::FramebufferConfig& framebuffer) { |
| 90 | return static_cast<std::size_t>(framebuffer.stride) * | 90 | // TODO(Rodrigo): Read this from HLE |
| 91 | static_cast<std::size_t>(framebuffer.height) * GetBytesPerPixel(framebuffer); | 91 | constexpr u32 block_height_log2 = 4; |
| 92 | const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); | ||
| 93 | const u64 size_bytes{Tegra::Texture::CalculateSize( | ||
| 94 | true, bytes_per_pixel, framebuffer.stride, framebuffer.height, 1, block_height_log2, 0)}; | ||
| 95 | return size_bytes; | ||
| 92 | } | 96 | } |
| 93 | 97 | ||
| 94 | VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { | 98 | VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { |
| @@ -169,9 +173,8 @@ VkSemaphore BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer, | |||
| 169 | // TODO(Rodrigo): Read this from HLE | 173 | // TODO(Rodrigo): Read this from HLE |
| 170 | constexpr u32 block_height_log2 = 4; | 174 | constexpr u32 block_height_log2 = 4; |
| 171 | const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); | 175 | const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); |
| 172 | const u64 size_bytes{Tegra::Texture::CalculateSize(true, bytes_per_pixel, | 176 | const u64 size_bytes{GetSizeInBytes(framebuffer)}; |
| 173 | framebuffer.stride, framebuffer.height, | 177 | |
| 174 | 1, block_height_log2, 0)}; | ||
| 175 | Tegra::Texture::UnswizzleTexture( | 178 | Tegra::Texture::UnswizzleTexture( |
| 176 | mapped_span.subspan(image_offset, size_bytes), std::span(host_ptr, size_bytes), | 179 | mapped_span.subspan(image_offset, size_bytes), std::span(host_ptr, size_bytes), |
| 177 | bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0); | 180 | bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0); |