summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/surface_params.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-02 05:03:22 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:38:34 +0200
commit9f755218a1359cbd004e6c287f5fead0897c1d11 (patch)
tree9a0e4187602f3c650b7367d268b46e22892b5a5c /src/video_core/texture_cache/surface_params.cpp
parenttexture_cache: Optimize GetSurface and use references on functions that don't change a surface. (diff)
downloadyuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar.gz
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar.bz2
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar.lz
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar.xz
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.tar.zst
yuzu-9f755218a1359cbd004e6c287f5fead0897c1d11.zip
Diffstat (limited to 'src/video_core/texture_cache/surface_params.cpp')
-rw-r--r--src/video_core/texture_cache/surface_params.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 77c09264a..60a7356bb 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -6,7 +6,6 @@
#include "common/alignment.h"
#include "common/bit_util.h"
-#include "common/cityhash.h"
#include "core/core.h"
#include "video_core/engines/shader_bytecode.h"
#include "video_core/surface.h"
@@ -237,14 +236,6 @@ std::size_t SurfaceParams::GetConvertedMipmapOffset(u32 level) const {
return offset;
}
-std::size_t SurfaceParams::GetGuestMipmapSize(u32 level) const {
- return GetInnerMipmapMemorySize(level, false, false);
-}
-
-std::size_t SurfaceParams::GetHostMipmapSize(u32 level) const {
- return GetInnerMipmapMemorySize(level, true, false) * GetNumLayers();
-}
-
std::size_t SurfaceParams::GetConvertedMipmapSize(u32 level) const {
constexpr std::size_t rgb8_bpp = 4ULL;
const std::size_t width_t = GetMipWidth(level);
@@ -253,10 +244,6 @@ std::size_t SurfaceParams::GetConvertedMipmapSize(u32 level) const {
return width_t * height_t * depth_t * rgb8_bpp;
}
-std::size_t SurfaceParams::GetGuestLayerSize() const {
- return GetLayerSize(false, false);
-}
-
std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) const {
std::size_t size = 0;
for (u32 level = 0; level < num_levels; ++level) {
@@ -269,16 +256,6 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co
return size;
}
-std::size_t SurfaceParams::GetHostLayerSize(u32 level) const {
- ASSERT(target != SurfaceTarget::Texture3D);
- return GetInnerMipmapMemorySize(level, true, false);
-}
-
-bool SurfaceParams::IsPixelFormatZeta() const {
- return pixel_format >= VideoCore::Surface::PixelFormat::MaxColorFormat &&
- pixel_format < VideoCore::Surface::PixelFormat::MaxDepthStencilFormat;
-}
-
std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size,
bool uncompressed) const {
const bool tiled{as_host_size ? false : is_tiled};
@@ -289,16 +266,6 @@ std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size
GetMipBlockHeight(level), GetMipBlockDepth(level));
}
-std::size_t SurfaceParams::GetInnerMemorySize(bool as_host_size, bool layer_only,
- bool uncompressed) const {
- return GetLayerSize(as_host_size, uncompressed) * (layer_only ? 1U : depth);
-}
-
-std::size_t SurfaceParams::Hash() const {
- return static_cast<std::size_t>(
- Common::CityHash64(reinterpret_cast<const char*>(this), sizeof(*this)));
-}
-
bool SurfaceParams::operator==(const SurfaceParams& rhs) const {
return std::tie(is_tiled, block_width, block_height, block_depth, tile_width_spacing, width,
height, depth, pitch, num_levels, pixel_format, component_type, type, target) ==