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 8 #ifndef skgpu_graphite_ComputePipeline_DEFINED 9 #define skgpu_graphite_ComputePipeline_DEFINED 10 11 #include "src/gpu/graphite/Resource.h" 12 13 namespace skgpu::graphite { 14 15 class SharedContext; 16 17 /** 18 * ComputePipeline corresponds to a backend specific pipeline used for compute (vs rendering), 19 * e.g. MTLComputePipelineState (Metal), 20 * CreateComputePipeline (Dawn), 21 * CreateComputePipelineState (D3D12), 22 * or VkComputePipelineCreateInfo (Vulkan). 23 */ 24 class ComputePipeline : public Resource { 25 public: 26 ~ComputePipeline() override = default; 27 28 // TODO(b/240615224): The pipeline should return an optional effective local workgroup 29 // size if the value was statically assigned in the shader (when it's not possible to assign 30 // them via specialization constants). 31 getResourceType()32 const char* getResourceType() const override { return "Compute Pipeline"; } 33 34 protected: 35 explicit ComputePipeline(const SharedContext*); 36 }; 37 38 } // namespace skgpu::graphite 39 40 #endif // skgpu_graphite_ComputePipeline_DEFINED 41