| 1 |
/* |
| 2 |
* Copyright 2025 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 skgpu_graphite_precompile_SerializationUtils_DEFINED |
| 9 |
#define skgpu_graphite_precompile_SerializationUtils_DEFINED |
| 10 |
|
| 11 |
#include "include/core/SkRefCnt.h" |
| 12 |
|
| 13 |
class SkData; |
| 14 |
|
| 15 |
namespace skgpu::graphite { |
| 16 |
|
| 17 |
class Caps; |
| 18 |
class GraphicsPipelineDesc; |
| 19 |
struct RenderPassDesc; |
| 20 |
class ShaderCodeDictionary; |
| 21 |
|
| 22 |
// These are the top-level entry points to serialize Pipeline data for the Android-style |
| 23 |
// Precompilation API |
| 24 |
[[nodiscard]] sk_sp<SkData> PipelineDescToData(const Caps*, |
| 25 |
ShaderCodeDictionary*, |
| 26 |
const GraphicsPipelineDesc&, |
| 27 |
const RenderPassDesc&); |
| 28 |
|
| 29 |
[[nodiscard]] bool DataToPipelineDesc(const Caps*, |
| 30 |
ShaderCodeDictionary*, |
| 31 |
const SkData*, |
| 32 |
GraphicsPipelineDesc* pipelineDesc, |
| 33 |
RenderPassDesc* renderPassDesc); |
| 34 |
|
| 35 |
#if defined(GPU_TEST_UTILS) |
| 36 |
void DumpPipelineDesc(const char* label, |
| 37 |
ShaderCodeDictionary*, |
| 38 |
const GraphicsPipelineDesc&, |
| 39 |
const RenderPassDesc&); |
| 40 |
|
| 41 |
[[nodiscard]] bool ComparePipelineDescs(const GraphicsPipelineDesc& a1, const RenderPassDesc& b1, |
| 42 |
const GraphicsPipelineDesc& a2, const RenderPassDesc& b2); |
| 43 |
#endif |
| 44 |
|
| 45 |
} // skgpu::graphite |
| 46 |
|
| 47 |
#endif // skgpu_graphite_precompile_SerializationUtils_DEFINED |