diff options
| author | bunnei <bunneidev@gmail.com> | 2019-07-14 22:44:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-14 22:44:36 -0400 |
| commit | 9009501845d7c31064a16c94f23980b4d8a4a2f5 (patch) | |
| tree | b0a6a257a099f2ff18ee48c898c59671cc566de0 /src/video_core/texture_cache/surface_params.cpp | |
| parent | 8298de49b0f4d161c5d3aa5fa1edc9c47ad4bd37 (diff) | |
| parent | 03e55c48d635463b9d9d986761d7e1ef90f328c4 (diff) | |
Merge pull request #2705 from FernandoS27/tex-cache-fixes
GPU: Fixes to Texture Cache and Include Microprofiles for GL State/BufferCopy/Macro Interpreter
Diffstat (limited to 'src/video_core/texture_cache/surface_params.cpp')
| -rw-r--r-- | src/video_core/texture_cache/surface_params.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp index 9c56e2b4f1..fd54724513 100644 --- a/src/video_core/texture_cache/surface_params.cpp +++ b/src/video_core/texture_cache/surface_params.cpp @@ -290,12 +290,19 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size, bool uncompressed) const { - const bool tiled{as_host_size ? false : is_tiled}; const u32 width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())}; const u32 height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())}; const u32 depth{is_layered ? 1U : GetMipDepth(level)}; - return Tegra::Texture::CalculateSize(tiled, GetBytesPerPixel(), width, height, depth, - GetMipBlockHeight(level), GetMipBlockDepth(level)); + if (is_tiled) { + return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), width, height, + depth, GetMipBlockHeight(level), + GetMipBlockDepth(level)); + } else if (as_host_size || IsBuffer()) { + return GetBytesPerPixel() * width * height * depth; + } else { + // Linear Texture Case + return pitch * height * depth; + } } bool SurfaceParams::operator==(const SurfaceParams& rhs) const { |
