Make the size of program/pipeline caches configurable in GrContextOptions
Change-Id: I988fd8cc7e78e2124f20b7d8a815f160bb166756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index 0c25c6f..68c0be1 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -6,7 +6,9 @@
*/
+#include "include/gpu/GrContextOptions.h"
#include "src/core/SkOpts.h"
+#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrProcessor.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrStencilSettings.h"
@@ -38,7 +40,7 @@
};
GrVkResourceProvider::PipelineStateCache::PipelineStateCache(GrVkGpu* gpu)
- : fMap(kMaxEntries)
+ : fMap(gpu->getContext()->priv().options().fRuntimeProgramCacheSize)
, fGpu(gpu)
#ifdef GR_PIPELINE_STATE_CACHE_STATS
, fTotalRequests(0)