aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xREADME.md2
-rwxr-xr-xsrc/video_core/buffer_cache/buffer_cache.h2
-rwxr-xr-xsrc/video_core/surface.cpp14
-rwxr-xr-xsrc/video_core/surface.h2
-rwxr-xr-xsrc/video_core/texture_cache/texture_cache.h6
5 files changed, 8 insertions, 18 deletions
diff --git a/README.md b/README.md
index 161a5081f..2cd872097 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
1yuzu emulator early access 1yuzu emulator early access
2============= 2=============
3 3
4This is the source code for early-access 4140. 4This is the source code for early-access 4141.
5 5
6## Legal Notice 6## Legal Notice
7 7
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 1d6c117b1..1f33301b7 100755
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -35,7 +35,7 @@ BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R
35 const s64 min_spacing_critical = device_local_memory - 512_MiB; 35 const s64 min_spacing_critical = device_local_memory - 512_MiB;
36 const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); 36 const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD);
37 const s64 min_vacancy_expected = (6 * mem_threshold) / 10; 37 const s64 min_vacancy_expected = (6 * mem_threshold) / 10;
38 const s64 min_vacancy_critical = (2 * mem_threshold) / 10; 38 const s64 min_vacancy_critical = (3 * mem_threshold) / 10;
39 minimum_memory = static_cast<u64>( 39 minimum_memory = static_cast<u64>(
40 std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), 40 std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected),
41 DEFAULT_EXPECTED_MEMORY)); 41 DEFAULT_EXPECTED_MEMORY));
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index a94d2371a..c48e19ffa 100755
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -3,7 +3,6 @@
3 3
4#include "common/common_types.h" 4#include "common/common_types.h"
5#include "common/math_util.h" 5#include "common/math_util.h"
6#include "common/settings.h"
7#include "video_core/surface.h" 6#include "video_core/surface.h"
8 7
9namespace VideoCore::Surface { 8namespace VideoCore::Surface {
@@ -401,20 +400,11 @@ std::pair<u32, u32> GetASTCBlockSize(PixelFormat format) {
401 return {DefaultBlockWidth(format), DefaultBlockHeight(format)}; 400 return {DefaultBlockWidth(format), DefaultBlockHeight(format)};
402} 401}
403 402
404u64 TranscodedAstcSize(u64 base_size, PixelFormat format) { 403u64 EstimatedDecompressedSize(u64 base_size, PixelFormat format) {
405 constexpr u64 RGBA8_PIXEL_SIZE = 4; 404 constexpr u64 RGBA8_PIXEL_SIZE = 4;
406 const u64 base_block_size = static_cast<u64>(DefaultBlockWidth(format)) * 405 const u64 base_block_size = static_cast<u64>(DefaultBlockWidth(format)) *
407 static_cast<u64>(DefaultBlockHeight(format)) * RGBA8_PIXEL_SIZE; 406 static_cast<u64>(DefaultBlockHeight(format)) * RGBA8_PIXEL_SIZE;
408 const u64 uncompressed_size = (base_size * base_block_size) / BytesPerBlock(format); 407 return (base_size * base_block_size) / BytesPerBlock(format);
409
410 switch (Settings::values.astc_recompression.GetValue()) {
411 case Settings::AstcRecompression::Bc1:
412 return uncompressed_size / 8;
413 case Settings::AstcRecompression::Bc3:
414 return uncompressed_size / 4;
415 default:
416 return uncompressed_size;
417 }
418} 408}
419 409
420} // namespace VideoCore::Surface 410} // namespace VideoCore::Surface
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 2c212a6b1..9ac9b6343 100755
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -517,6 +517,6 @@ size_t PixelComponentSizeBitsInteger(PixelFormat format);
517 517
518std::pair<u32, u32> GetASTCBlockSize(PixelFormat format); 518std::pair<u32, u32> GetASTCBlockSize(PixelFormat format);
519 519
520u64 TranscodedAstcSize(u64 base_size, PixelFormat format); 520u64 EstimatedDecompressedSize(u64 base_size, PixelFormat format);
521 521
522} // namespace VideoCore::Surface 522} // namespace VideoCore::Surface
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index f790897ef..47ea0bd96 100755
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -55,7 +55,7 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
55 const s64 min_spacing_critical = device_local_memory - 512_MiB; 55 const s64 min_spacing_critical = device_local_memory - 512_MiB;
56 const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); 56 const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD);
57 const s64 min_vacancy_expected = (6 * mem_threshold) / 10; 57 const s64 min_vacancy_expected = (6 * mem_threshold) / 10;
58 const s64 min_vacancy_critical = (2 * mem_threshold) / 10; 58 const s64 min_vacancy_critical = (3 * mem_threshold) / 10;
59 expected_memory = static_cast<u64>( 59 expected_memory = static_cast<u64>(
60 std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), 60 std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected),
61 DEFAULT_EXPECTED_MEMORY)); 61 DEFAULT_EXPECTED_MEMORY));
@@ -1979,7 +1979,7 @@ void TextureCache<P>::RegisterImage(ImageId image_id) {
1979 if ((IsPixelFormatASTC(image.info.format) && 1979 if ((IsPixelFormatASTC(image.info.format) &&
1980 True(image.flags & ImageFlagBits::AcceleratedUpload)) || 1980 True(image.flags & ImageFlagBits::AcceleratedUpload)) ||
1981 True(image.flags & ImageFlagBits::Converted)) { 1981 True(image.flags & ImageFlagBits::Converted)) {
1982 tentative_size = TranscodedAstcSize(tentative_size, image.info.format); 1982 tentative_size = EstimatedDecompressedSize(tentative_size, image.info.format);
1983 } 1983 }
1984 total_used_memory += Common::AlignUp(tentative_size, 1024); 1984 total_used_memory += Common::AlignUp(tentative_size, 1024);
1985 image.lru_index = lru_cache.Insert(image_id, frame_tick); 1985 image.lru_index = lru_cache.Insert(image_id, frame_tick);
@@ -2149,7 +2149,7 @@ void TextureCache<P>::DeleteImage(ImageId image_id, bool immediate_delete) {
2149 if ((IsPixelFormatASTC(image.info.format) && 2149 if ((IsPixelFormatASTC(image.info.format) &&
2150 True(image.flags & ImageFlagBits::AcceleratedUpload)) || 2150 True(image.flags & ImageFlagBits::AcceleratedUpload)) ||
2151 True(image.flags & ImageFlagBits::Converted)) { 2151 True(image.flags & ImageFlagBits::Converted)) {
2152 tentative_size = TranscodedAstcSize(tentative_size, image.info.format); 2152 tentative_size = EstimatedDecompressedSize(tentative_size, image.info.format);
2153 } 2153 }
2154 total_used_memory -= Common::AlignUp(tentative_size, 1024); 2154 total_used_memory -= Common::AlignUp(tentative_size, 1024);
2155 const GPUVAddr gpu_addr = image.gpu_addr; 2155 const GPUVAddr gpu_addr = image.gpu_addr;