[graphite] Move DepthStencilState caching to MtlSharedContext
This CL does two things:
it makes the caching of the Mtl DepthStencilState threadsafe by pre-filling the cache
it moves that cache from the MtlResourceProvider to the MtlSharedContext
The first is necessary bc we want to create Pipelines simultaneously in separate threads (and the old caching mechanism had races).
The second is a bit of a judgement call. It seems like the cache should be in a new MtlGlobalCache class object but the GlobalCache concept might be going away. Additionally, there is a race condition wrt the ResourceProvider's destruction. The PipelineManager is owned by the SharedContext so has to be resilent to the ResourceProvider going away (since the ResourceProvider is owned by a Recorder or a PrecompileContext).
Change-Id: I452bdb8329e0a00b68f9adf222d201f3c87c74c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1053078
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
6 files changed