summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/surface_params.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-12-08 18:13:18 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-12-22 17:24:34 +0100
commit51c9e98677395564a4fafeaba718cbd2263541bb (patch)
tree7546b488cf1753f227ba9e409a96ff247bc5ae73 /src/video_core/texture_cache/surface_params.h
parentMerge pull request #3230 from ReinUsesLisp/vk-emu-shaders (diff)
downloadyuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar.gz
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar.bz2
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar.lz
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar.xz
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.tar.zst
yuzu-51c9e98677395564a4fafeaba718cbd2263541bb.zip
Diffstat (limited to 'src/video_core/texture_cache/surface_params.h')
-rw-r--r--src/video_core/texture_cache/surface_params.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h
index 129817ad3..1c6be25da 100644
--- a/src/video_core/texture_cache/surface_params.h
+++ b/src/video_core/texture_cache/surface_params.h
@@ -4,6 +4,8 @@
#pragma once
+#include <utility>
+
#include "common/alignment.h"
#include "common/bit_util.h"
#include "common/cityhash.h"
@@ -136,6 +138,15 @@ public:
std::size_t GetConvertedMipmapSize(u32 level) const;
+ // Get this texture Tegra Block size in guest memory layout
+ u32 GetBlockSize() const;
+
+ // Get X, Y sizes of a block
+ std::pair<u32, u32> GetBlockXY() const;
+
+ // Get the offset in x, y, z coordinates from a memory offset
+ std::tuple<u32, u32, u32> GetBlockOffsetXYZ(u32 offset) const;
+
/// Returns the size of a layer in bytes in guest memory.
std::size_t GetGuestLayerSize() const {
return GetLayerSize(false, false);
@@ -269,7 +280,8 @@ private:
/// Returns the size of all mipmap levels and aligns as needed.
std::size_t GetInnerMemorySize(bool as_host_size, bool layer_only, bool uncompressed) const {
- return GetLayerSize(as_host_size, uncompressed) * (layer_only ? 1U : depth);
+ return GetLayerSize(as_host_size, uncompressed) *
+ (layer_only ? 1U : (is_layered ? depth : 1U));
}
/// Returns the size of a layer