EGL BlobCache: Update multifile key and value size
Make it clearer what the key and value size limits are.
Base the hot cache on those values, rather than the
other way around.
Test: pubg_mobile_launch ANGLE trace
Test: /data/nativetest64/EGL_test/EGL_test
Test: /data/nativetest64/libEGL_test/libEGL_test
Bug: b/266725576
Change-Id: I337beaf0e01c6497f619c29c01f94242c7b5c959
diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp
index 3dc93ee..1b68344 100644
--- a/opengl/libs/EGL/egl_cache.cpp
+++ b/opengl/libs/EGL/egl_cache.cpp
@@ -38,8 +38,9 @@
static const unsigned int kDeferredMonolithicSaveDelay = 4;
// Multifile cache size limits
-constexpr uint32_t kMultifileHotCacheLimit = 8 * 1024 * 1024;
-constexpr uint32_t kMultifileCacheByteLimit = 32 * 1024 * 1024;
+constexpr uint32_t kMaxMultifileKeySize = 1 * 1024 * 1024;
+constexpr uint32_t kMaxMultifileValueSize = 8 * 1024 * 1024;
+constexpr uint32_t kMaxMultifileTotalSize = 32 * 1024 * 1024;
namespace android {
@@ -250,7 +251,7 @@
if (mMultifileMode) {
mCacheByteLimit = static_cast<size_t>(
base::GetUintProperty<uint32_t>("ro.egl.blobcache.multifile_limit",
- kMultifileCacheByteLimit));
+ kMaxMultifileTotalSize));
// Check for a debug value
int debugCacheSize = base::GetIntProperty("debug.egl.blobcache.multifile_limit", -1);
@@ -274,8 +275,9 @@
MultifileBlobCache* egl_cache_t::getMultifileBlobCacheLocked() {
if (mMultifileBlobCache == nullptr) {
- mMultifileBlobCache.reset(
- new MultifileBlobCache(mCacheByteLimit, kMultifileHotCacheLimit, mFilename));
+ mMultifileBlobCache.reset(new MultifileBlobCache(kMaxMultifileKeySize,
+ kMaxMultifileValueSize, mCacheByteLimit,
+ mFilename));
}
return mMultifileBlobCache.get();
}