summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nolan Scobie <nscobie@google.com> 2023-02-09 13:43:52 -0500
committer Nolan Scobie <nscobie@google.com> 2023-02-09 17:19:58 -0500
commitf50917cd0afbffaf5006563a25a3db5d19f26449 (patch)
tree63f6ecf59873c8ef46ce5a1801e3099d81ca267d
parent9a2b9d08005f81b22117ca05891afc698a96ef90 (diff)
Increase max shader cache size
Bumps maxTotalSize (max size of the entire cache) to align with the previous bump to maxValueSize (max size of an single entry in the cache) in I1be3da0458c4b64f7082a2e1bc0d08b0824bbeba, which was discussed on b/190348616. I chose 4 MiB here to keep the new values linearly proportionate to their original values. Note: this entire cache is stored in both RAM and flash. If 4 MiB is too much, we could alternatively set maxTotalSize to 2 MiB and reduce maxValueSize to 1 MiB (if maintaining the original proportions is important). Bug: 190348616 Test: builds (with new static_assert) and passes hwui_unit_tests Change-Id: Ib101d1c432f3547483f52e64fad81bf0a1e20f07
-rw-r--r--libs/hwui/pipeline/skia/ShaderCache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/pipeline/skia/ShaderCache.cpp b/libs/hwui/pipeline/skia/ShaderCache.cpp
index a55de95035a7..c1bcb5550e51 100644
--- a/libs/hwui/pipeline/skia/ShaderCache.cpp
+++ b/libs/hwui/pipeline/skia/ShaderCache.cpp
@@ -33,7 +33,8 @@ namespace skiapipeline {
// Cache size limits.
static const size_t maxKeySize = 1024;
static const size_t maxValueSize = 2 * 1024 * 1024;
-static const size_t maxTotalSize = 1024 * 1024;
+static const size_t maxTotalSize = 4 * 1024 * 1024;
+static_assert(maxKeySize + maxValueSize < maxTotalSize);
ShaderCache::ShaderCache() {
// There is an "incomplete FileBlobCache type" compilation error, if ctor is moved to header.