| 1 |
/* |
| 2 |
* Copyright 2022 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 |
#ifndef skgpu_graphite_ComputePipelineDesc_DEFINED |
| 8 |
#define skgpu_graphite_ComputePipelineDesc_DEFINED |
| 9 |
|
| 10 |
#include "src/gpu/graphite/compute/ComputeStep.h" |
| 11 |
|
| 12 |
#include <cstdint> |
| 13 |
|
| 14 |
namespace skgpu::graphite { |
| 15 |
|
| 16 |
/** |
| 17 |
* ComputePipelineDesc represents the state needed to create a backend specific ComputePipeline. |
| 18 |
*/ |
| 19 |
class ComputePipelineDesc { |
| 20 |
public: |
| 21 |
// `computeStep` must outlive this `ComputePipelineDesc`. |
| 22 |
explicit ComputePipelineDesc(const ComputeStep* computeStep) : fComputeStep(computeStep) {} |
| 23 |
|
| 24 |
bool operator==(const ComputePipelineDesc& that) const { |
| 25 |
return fComputeStep->uniqueID() == that.fComputeStep->uniqueID(); |
| 26 |
} |
| 27 |
|
| 28 |
const ComputeStep* computeStep() const { return fComputeStep; } |
| 29 |
|
| 30 |
uint32_t uniqueID() const { return fComputeStep->uniqueID(); } |
| 31 |
|
| 32 |
private: |
| 33 |
const ComputeStep* fComputeStep; |
| 34 |
}; |
| 35 |
|
| 36 |
} // namespace skgpu::graphite |
| 37 |
|
| 38 |
#endif // skgpu_graphite_ComputePipelineDesc_DEFINED |