Flutter Engine
The Flutter Engine
|
#include <GlobalCache.h>
Public Member Functions | |
GlobalCache () | |
~GlobalCache () | |
void | deleteResources () |
sk_sp< GraphicsPipeline > | findGraphicsPipeline (const UniqueKey &) SK_EXCLUDES(fSpinLock) |
sk_sp< GraphicsPipeline > | addGraphicsPipeline (const UniqueKey &, sk_sp< GraphicsPipeline >) SK_EXCLUDES(fSpinLock) |
sk_sp< ComputePipeline > | findComputePipeline (const UniqueKey &) SK_EXCLUDES(fSpinLock) |
sk_sp< ComputePipeline > | addComputePipeline (const UniqueKey &, sk_sp< ComputePipeline >) SK_EXCLUDES(fSpinLock) |
void | addStaticResource (sk_sp< Resource >) SK_EXCLUDES(fSpinLock) |
GlobalCache holds GPU resources that should be shared by every Recorder. The common requirement of these resources are they are static/read-only, have long lifetimes, and are likely to be used by multiple Recorders. The canonical example of this are pipelines.
GlobalCache is thread safe, but intentionally splits queries and storing operations so that they are not atomic. The pattern is to query for a resource, which has a high likelihood of a cache hit. If it's not found, the Recorder creates the resource on its own, without locking the GlobalCache. After the resource is created, it is added to the GlobalCache, atomically returning the winning Resource in the event of a race between Recorders for the same UniqueKey.
Definition at line 37 of file GlobalCache.h.
skgpu::graphite::GlobalCache::GlobalCache | ( | ) |
Definition at line 17 of file GlobalCache.cpp.
skgpu::graphite::GlobalCache::~GlobalCache | ( | ) |
Definition at line 21 of file GlobalCache.cpp.
sk_sp< ComputePipeline > skgpu::graphite::GlobalCache::addComputePipeline | ( | const UniqueKey & | key, |
sk_sp< ComputePipeline > | pipeline | ||
) |
Definition at line 87 of file GlobalCache.cpp.
sk_sp< GraphicsPipeline > skgpu::graphite::GlobalCache::addGraphicsPipeline | ( | const UniqueKey & | key, |
sk_sp< GraphicsPipeline > | pipeline | ||
) |
Definition at line 44 of file GlobalCache.cpp.
Definition at line 97 of file GlobalCache.cpp.
void skgpu::graphite::GlobalCache::deleteResources | ( | ) |
Definition at line 29 of file GlobalCache.cpp.
sk_sp< ComputePipeline > skgpu::graphite::GlobalCache::findComputePipeline | ( | const UniqueKey & | key | ) |
Definition at line 81 of file GlobalCache.cpp.
sk_sp< GraphicsPipeline > skgpu::graphite::GlobalCache::findGraphicsPipeline | ( | const UniqueKey & | key | ) |
Definition at line 37 of file GlobalCache.cpp.