diff options
| -rw-r--r-- | src/video_core/morton.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/morton.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp index 96a3c99b3..e980bb8be 100644 --- a/src/video_core/morton.cpp +++ b/src/video_core/morton.cpp | |||
| @@ -16,12 +16,12 @@ namespace VideoCore { | |||
| 16 | using Surface::GetBytesPerPixel; | 16 | using Surface::GetBytesPerPixel; |
| 17 | using Surface::PixelFormat; | 17 | using Surface::PixelFormat; |
| 18 | 18 | ||
| 19 | using MortonCopyFn = void (*)(u32, u32, u32, u32, u32, u32, u8*, std::size_t, VAddr); | 19 | using MortonCopyFn = void (*)(u32, u32, u32, u32, u32, u32, u8*, VAddr); |
| 20 | using ConversionArray = std::array<MortonCopyFn, Surface::MaxPixelFormat>; | 20 | using ConversionArray = std::array<MortonCopyFn, Surface::MaxPixelFormat>; |
| 21 | 21 | ||
| 22 | template <bool morton_to_linear, PixelFormat format> | 22 | template <bool morton_to_linear, PixelFormat format> |
| 23 | static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth, u32 depth, | 23 | static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth, u32 depth, |
| 24 | u32 tile_width_spacing, u8* buffer, std::size_t buffer_size, VAddr addr) { | 24 | u32 tile_width_spacing, u8* buffer, VAddr addr) { |
| 25 | constexpr u32 bytes_per_pixel = GetBytesPerPixel(format); | 25 | constexpr u32 bytes_per_pixel = GetBytesPerPixel(format); |
| 26 | 26 | ||
| 27 | // With the BCn formats (DXT and DXN), each 4x4 tile is swizzled instead of just individual | 27 | // With the BCn formats (DXT and DXN), each 4x4 tile is swizzled instead of just individual |
| @@ -282,10 +282,9 @@ static u32 GetMortonOffset128(u32 x, u32 y, u32 bytes_per_pixel) { | |||
| 282 | 282 | ||
| 283 | void MortonSwizzle(MortonSwizzleMode mode, Surface::PixelFormat format, u32 stride, | 283 | void MortonSwizzle(MortonSwizzleMode mode, Surface::PixelFormat format, u32 stride, |
| 284 | u32 block_height, u32 height, u32 block_depth, u32 depth, u32 tile_width_spacing, | 284 | u32 block_height, u32 height, u32 block_depth, u32 depth, u32 tile_width_spacing, |
| 285 | u8* buffer, std::size_t buffer_size, VAddr addr) { | 285 | u8* buffer, VAddr addr) { |
| 286 | |||
| 287 | GetSwizzleFunction(mode, format)(stride, block_height, height, block_depth, depth, | 286 | GetSwizzleFunction(mode, format)(stride, block_height, height, block_depth, depth, |
| 288 | tile_width_spacing, buffer, buffer_size, addr); | 287 | tile_width_spacing, buffer, addr); |
| 289 | } | 288 | } |
| 290 | 289 | ||
| 291 | void MortonCopyPixels128(u32 width, u32 height, u32 bytes_per_pixel, u32 linear_bytes_per_pixel, | 290 | void MortonCopyPixels128(u32 width, u32 height, u32 bytes_per_pixel, u32 linear_bytes_per_pixel, |
diff --git a/src/video_core/morton.h b/src/video_core/morton.h index 065f59ce3..f2f104935 100644 --- a/src/video_core/morton.h +++ b/src/video_core/morton.h | |||
| @@ -13,7 +13,7 @@ enum class MortonSwizzleMode { MortonToLinear, LinearToMorton }; | |||
| 13 | 13 | ||
| 14 | void MortonSwizzle(MortonSwizzleMode mode, VideoCore::Surface::PixelFormat format, u32 stride, | 14 | void MortonSwizzle(MortonSwizzleMode mode, VideoCore::Surface::PixelFormat format, u32 stride, |
| 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, std::size_t buffer_size, 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(u32 width, u32 height, u32 bytes_per_pixel, u32 linear_bytes_per_pixel, |
| 19 | u8* morton_data, u8* linear_data, bool morton_to_linear); | 19 | u8* morton_data, u8* linear_data, bool morton_to_linear); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index e9eb6e921..bd1409660 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -446,7 +446,7 @@ void SwizzleFunc(const MortonSwizzleMode& mode, const SurfaceParams& params, | |||
| 446 | MortonSwizzle(mode, params.pixel_format, params.MipWidth(mip_level), | 446 | MortonSwizzle(mode, params.pixel_format, params.MipWidth(mip_level), |
| 447 | params.MipBlockHeight(mip_level), params.MipHeight(mip_level), | 447 | params.MipBlockHeight(mip_level), params.MipHeight(mip_level), |
| 448 | params.MipBlockDepth(mip_level), 1, params.tile_width_spacing, | 448 | params.MipBlockDepth(mip_level), 1, params.tile_width_spacing, |
| 449 | gl_buffer.data() + offset_gl, gl_size, params.addr + offset); | 449 | gl_buffer.data() + offset_gl, params.addr + offset); |
| 450 | offset += layer_size; | 450 | offset += layer_size; |
| 451 | offset_gl += gl_size; | 451 | offset_gl += gl_size; |
| 452 | } | 452 | } |
| @@ -455,7 +455,7 @@ void SwizzleFunc(const MortonSwizzleMode& mode, const SurfaceParams& params, | |||
| 455 | MortonSwizzle(mode, params.pixel_format, params.MipWidth(mip_level), | 455 | MortonSwizzle(mode, params.pixel_format, params.MipWidth(mip_level), |
| 456 | params.MipBlockHeight(mip_level), params.MipHeight(mip_level), | 456 | params.MipBlockHeight(mip_level), params.MipHeight(mip_level), |
| 457 | params.MipBlockDepth(mip_level), depth, params.tile_width_spacing, | 457 | params.MipBlockDepth(mip_level), depth, params.tile_width_spacing, |
| 458 | gl_buffer.data(), gl_buffer.size(), params.addr + offset); | 458 | gl_buffer.data(), params.addr + offset); |
| 459 | } | 459 | } |
| 460 | } | 460 | } |
| 461 | 461 | ||