summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index 4a1d96322..27e6ebf94 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -87,12 +87,8 @@ u32 GetBytesPerPixel(const Tegra::FramebufferConfig& framebuffer) {
87} 87}
88 88
89std::size_t GetSizeInBytes(const Tegra::FramebufferConfig& framebuffer) { 89std::size_t GetSizeInBytes(const Tegra::FramebufferConfig& framebuffer) {
90 // TODO(Rodrigo): Read this from HLE 90 return static_cast<std::size_t>(framebuffer.stride) *
91 constexpr u32 block_height_log2 = 4; 91 static_cast<std::size_t>(framebuffer.height) * GetBytesPerPixel(framebuffer);
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;
96} 92}
97 93
98VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { 94VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) {
@@ -173,10 +169,12 @@ VkSemaphore BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer,
173 // TODO(Rodrigo): Read this from HLE 169 // TODO(Rodrigo): Read this from HLE
174 constexpr u32 block_height_log2 = 4; 170 constexpr u32 block_height_log2 = 4;
175 const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); 171 const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer);
176 const u64 size_bytes{GetSizeInBytes(framebuffer)}; 172 const u64 linear_size{GetSizeInBytes(framebuffer)};
177 173 const u64 tiled_size{Tegra::Texture::CalculateSize(true, bytes_per_pixel,
174 framebuffer.stride, framebuffer.height,
175 1, block_height_log2, 0)};
178 Tegra::Texture::UnswizzleTexture( 176 Tegra::Texture::UnswizzleTexture(
179 mapped_span.subspan(image_offset, size_bytes), std::span(host_ptr, size_bytes), 177 mapped_span.subspan(image_offset, linear_size), std::span(host_ptr, tiled_size),
180 bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0); 178 bytes_per_pixel, framebuffer.width, framebuffer.height, 1, block_height_log2, 0);
181 179
182 const VkBufferImageCopy copy{ 180 const VkBufferImageCopy copy{