diff options
| -rw-r--r-- | src/video_core/morton.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/morton.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 8 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp index e980bb8be..9692ce143 100644 --- a/src/video_core/morton.cpp +++ b/src/video_core/morton.cpp | |||
| @@ -287,8 +287,9 @@ void MortonSwizzle(MortonSwizzleMode mode, Surface::PixelFormat format, u32 stri | |||
| 287 | tile_width_spacing, buffer, addr); | 287 | tile_width_spacing, buffer, addr); |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | void MortonCopyPixels128(u32 width, u32 height, u32 bytes_per_pixel, u32 linear_bytes_per_pixel, | 290 | void MortonCopyPixels128(MortonSwizzleMode mode, u32 width, u32 height, u32 bytes_per_pixel, |
| 291 | u8* morton_data, u8* linear_data, bool morton_to_linear) { | 291 | u32 linear_bytes_per_pixel, u8* morton_data, u8* linear_data) { |
| 292 | const bool morton_to_linear = mode == MortonSwizzleMode::MortonToLinear; | ||
| 292 | u8* data_ptrs[2]; | 293 | u8* data_ptrs[2]; |
| 293 | for (u32 y = 0; y < height; ++y) { | 294 | for (u32 y = 0; y < height; ++y) { |
| 294 | for (u32 x = 0; x < width; ++x) { | 295 | for (u32 x = 0; x < width; ++x) { |
diff --git a/src/video_core/morton.h b/src/video_core/morton.h index f2f104935..b565204b5 100644 --- a/src/video_core/morton.h +++ b/src/video_core/morton.h | |||
| @@ -15,7 +15,7 @@ void MortonSwizzle(MortonSwizzleMode mode, VideoCore::Surface::PixelFormat forma | |||
| 15 | u32 block_height, u32 height, u32 block_depth, u32 depth, u32 tile_width_spacing, | 15 | u32 block_height, u32 height, u32 block_depth, u32 depth, u32 tile_width_spacing, |
| 16 | u8* buffer, VAddr addr); | 16 | u8* buffer, VAddr addr); |
| 17 | 17 | ||
| 18 | void MortonCopyPixels128(u32 width, u32 height, u32 bytes_per_pixel, u32 linear_bytes_per_pixel, | 18 | void MortonCopyPixels128(MortonSwizzleMode mode, u32 width, u32 height, u32 bytes_per_pixel, |
| 19 | u8* morton_data, u8* linear_data, bool morton_to_linear); | 19 | u32 linear_bytes_per_pixel, u8* morton_data, u8* linear_data); |
| 20 | 20 | ||
| 21 | } // namespace VideoCore | 21 | } // namespace VideoCore |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 8b510b6ae..b97576309 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -167,9 +167,11 @@ void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuf | |||
| 167 | Memory::RasterizerFlushVirtualRegion(framebuffer_addr, size_in_bytes, | 167 | Memory::RasterizerFlushVirtualRegion(framebuffer_addr, size_in_bytes, |
| 168 | Memory::FlushMode::Flush); | 168 | Memory::FlushMode::Flush); |
| 169 | 169 | ||
| 170 | VideoCore::MortonCopyPixels128(framebuffer.width, framebuffer.height, bytes_per_pixel, 4, | 170 | constexpr u32 linear_bpp = 4; |
| 171 | Memory::GetPointer(framebuffer_addr), | 171 | VideoCore::MortonCopyPixels128(VideoCore::MortonSwizzleMode::MortonToLinear, |
| 172 | gl_framebuffer_data.data(), true); | 172 | framebuffer.width, framebuffer.height, bytes_per_pixel, |
| 173 | linear_bpp, Memory::GetPointer(framebuffer_addr), | ||
| 174 | gl_framebuffer_data.data()); | ||
| 173 | 175 | ||
| 174 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(framebuffer.stride)); | 176 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(framebuffer.stride)); |
| 175 | 177 | ||