Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/common/persistent_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std::atomic<bool> PersistentCache::cache_sksl_ = false;
std::atomic<bool> PersistentCache::strategy_set_ = false;

void PersistentCache::SetCacheSkSL(bool value) {
if (strategy_set_) {
if (strategy_set_ && value != cache_sksl_) {
FML_LOG(ERROR) << "Cache SkSL can only be set before the "
"GrContextOptions::fShaderCacheStrategy is set.";
return;
Expand Down
6 changes: 6 additions & 0 deletions shell/common/shell_io_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ sk_sp<GrContext> ShellIOManager::CreateCompatibleResourceLoadingContext(

GrContextOptions options = {};

if (PersistentCache::cache_sksl()) {
FML_LOG(INFO) << "Cache SkSL";
options.fShaderCacheStrategy = GrContextOptions::ShaderCacheStrategy::kSkSL;
}
PersistentCache::MarkStrategySet();

options.fPersistentCache = PersistentCache::GetCacheForProcess();

// There is currently a bug with doing GPU YUV to RGB conversions on the IO
Expand Down
2 changes: 1 addition & 1 deletion shell/gpu/gpu_surface_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate,
if (PersistentCache::cache_sksl()) {
FML_LOG(INFO) << "Cache SkSL";
options.fShaderCacheStrategy = GrContextOptions::ShaderCacheStrategy::kSkSL;
PersistentCache::MarkStrategySet();
}
PersistentCache::MarkStrategySet();
options.fPersistentCache = PersistentCache::GetCacheForProcess();

options.fAvoidStencilBuffers = true;
Expand Down