summaryrefslogtreecommitdiffstats
path: root/src/video_core/morton.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-02-24 06:15:35 +0100
committerbunnei <bunneidev@gmail.com>2019-03-16 05:38:48 +0100
commit574e89d924b484b846f4eb522c5a62af9d63e801 (patch)
tree24b2d6e21b9e3aff77f2242eb94ec49a2b8e67c9 /src/video_core/morton.cpp
parentMerge pull request #2237 from bunnei/cache-host-addr (diff)
downloadyuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar.gz
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar.bz2
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar.lz
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar.xz
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.tar.zst
yuzu-574e89d924b484b846f4eb522c5a62af9d63e801.zip
Diffstat (limited to 'src/video_core/morton.cpp')
-rw-r--r--src/video_core/morton.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 9692ce143..3e91cbc83 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -6,7 +6,6 @@
#include <cstring>
#include "common/assert.h"
#include "common/common_types.h"
-#include "core/memory.h"
#include "video_core/morton.h"
#include "video_core/surface.h"
#include "video_core/textures/decoders.h"
@@ -16,12 +15,12 @@ namespace VideoCore {
using Surface::GetBytesPerPixel;
using Surface::PixelFormat;
-using MortonCopyFn = void (*)(u32, u32, u32, u32, u32, u32, u8*, VAddr);
+using MortonCopyFn = void (*)(u32, u32, u32, u32, u32, u32, u8*, u8*);
using ConversionArray = std::array<MortonCopyFn, Surface::MaxPixelFormat>;
template <bool morton_to_linear, PixelFormat format>
static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth, u32 depth,
- u32 tile_width_spacing, u8* buffer, VAddr addr) {
+ u32 tile_width_spacing, u8* buffer, u8* addr) {
constexpr u32 bytes_per_pixel = GetBytesPerPixel(format);
// With the BCn formats (DXT and DXN), each 4x4 tile is swizzled instead of just individual
@@ -34,10 +33,10 @@ static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth
stride, height, depth, block_height, block_depth,
tile_width_spacing);
} else {
- Tegra::Texture::CopySwizzledData(
- (stride + tile_size_x - 1) / tile_size_x, (height + tile_size_y - 1) / tile_size_y,
- depth, bytes_per_pixel, bytes_per_pixel, Memory::GetPointer(addr), buffer, false,
- block_height, block_depth, tile_width_spacing);
+ Tegra::Texture::CopySwizzledData((stride + tile_size_x - 1) / tile_size_x,
+ (height + tile_size_y - 1) / tile_size_y, depth,
+ bytes_per_pixel, bytes_per_pixel, addr, buffer, false,
+ block_height, block_depth, tile_width_spacing);
}
}
@@ -282,7 +281,7 @@ static u32 GetMortonOffset128(u32 x, u32 y, u32 bytes_per_pixel) {
void MortonSwizzle(MortonSwizzleMode mode, Surface::PixelFormat format, u32 stride,
u32 block_height, u32 height, u32 block_depth, u32 depth, u32 tile_width_spacing,
- u8* buffer, VAddr addr) {
+ u8* buffer, u8* addr) {
GetSwizzleFunction(mode, format)(stride, block_height, height, block_depth, depth,
tile_width_spacing, buffer, addr);
}