1 /* 2 * Copyright 2024 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef UniqueKeyUtils_DEFINED 9 #define UniqueKeyUtils_DEFINED 10 11 #include "include/core/SkTypes.h" 12 13 #include <vector> 14 15 namespace skgpu { 16 class UniqueKey; 17 } 18 19 namespace skgpu::graphite { 20 class Context; 21 class GlobalCache; 22 class GraphicsPipelineDesc; 23 struct RenderPassDesc; 24 class RendererProvider; 25 class ShaderCodeDictionary; 26 } 27 28 namespace UniqueKeyUtils { 29 30 void FetchUniqueKeys(skgpu::graphite::GlobalCache* globalCache, 31 std::vector<skgpu::UniqueKey>* keys); 32 33 #ifdef SK_DEBUG 34 void DumpDescs(const skgpu::graphite::RendererProvider*, 35 const skgpu::graphite::ShaderCodeDictionary*, 36 const skgpu::graphite::GraphicsPipelineDesc&, 37 const skgpu::graphite::RenderPassDesc&); 38 #endif 39 40 // This helper breaks a UniqueKey down into its GraphicsPipelineDesc 41 // and a RenderPassDesc and checks that the reassembled pieces match the 42 // original. 43 bool ExtractKeyDescs(skgpu::graphite::Context*, 44 const skgpu::UniqueKey&, 45 skgpu::graphite::GraphicsPipelineDesc*, 46 skgpu::graphite::RenderPassDesc*); 47 48 } // namespace UniqueKeyUtils 49 50 #endif // UniqueKeyUtils_DEFINED 51