diff options
author | Liam <byteslice@airmail.cc> | 2022-07-19 23:46:26 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-07-19 23:46:26 +0200 |
commit | 382b41b18f304fcd7aca76b004f7e19f52706d27 (patch) | |
tree | a9536d219cc3f887b69e45d3f805334b445bd6e2 | |
parent | Merge pull request #8569 from merryhime/watchpoints (diff) | |
download | yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar.gz yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar.bz2 yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar.lz yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar.xz yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.tar.zst yuzu-382b41b18f304fcd7aca76b004f7e19f52706d27.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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) { } std::size_t GetSizeInBytes(const Tegra::FramebufferConfig& framebuffer) { - return static_cast<std::size_t>(framebuffer.stride) * - static_cast<std::size_t>(framebuffer.height) * GetBytesPerPixel(framebuffer); + // TODO(Rodrigo): Read this from HLE + constexpr u32 block_height_log2 = 4; + const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); + const u64 size_bytes{Tegra::Texture::CalculateSize( + true, bytes_per_pixel, framebuffer.stride, framebuffer.height, 1, block_height_log2, 0)}; + return size_bytes; } VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { @@ -169,9 +173,8 @@ VkSemaphore BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer, // TODO(Rodrigo): Read this from HLE constexpr u32 block_height_log2 = 4; const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); - const u64 size_bytes{Tegra::Texture::CalculateSize(true, bytes_per_pixel, - framebuffer.stride, framebuffer.height, - 1, block_height_log2, 0)}; + const u64 size_bytes{GetSizeInBytes(framebuffer)}; + Tegra::Texture::UnswizzleTexture( mapped_span.subspan(image_offset, size_bytes), std::span(host_ptr, size_bytes), bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0); |