Flutter Impeller
compute_pipeline_vk.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 namespace impeller {
8 
10  std::weak_ptr<DeviceHolderVK> device_holder,
11  std::weak_ptr<PipelineLibrary> library,
12  const ComputePipelineDescriptor& desc,
13  vk::UniquePipeline pipeline,
14  vk::UniquePipelineLayout layout,
15  vk::UniqueDescriptorSetLayout descriptor_set_layout,
16  PipelineKey pipeline_key)
17  : Pipeline(std::move(library), desc),
18  device_holder_(std::move(device_holder)),
19  pipeline_(std::move(pipeline)),
20  layout_(std::move(layout)),
21  descriptor_set_layout_(std::move(descriptor_set_layout)),
22  pipeline_key_(pipeline_key) {
23  is_valid_ = pipeline_ && layout_ && descriptor_set_layout_;
24 }
25 
27  std::shared_ptr<DeviceHolderVK> device_holder = device_holder_.lock();
28  if (device_holder) {
29  descriptor_set_layout_.reset();
30  layout_.reset();
31  pipeline_.reset();
32  } else {
33  descriptor_set_layout_.release();
34  layout_.release();
35  pipeline_.release();
36  }
37 }
38 
39 bool ComputePipelineVK::IsValid() const {
40  return is_valid_;
41 }
42 
43 const vk::Pipeline& ComputePipelineVK::GetPipeline() const {
44  return *pipeline_;
45 }
46 
47 const vk::PipelineLayout& ComputePipelineVK::GetPipelineLayout() const {
48  return *layout_;
49 }
50 
51 const vk::DescriptorSetLayout& ComputePipelineVK::GetDescriptorSetLayout()
52  const {
53  return *descriptor_set_layout_;
54 }
55 
57  return pipeline_key_;
58 }
59 
60 } // namespace impeller
const vk::DescriptorSetLayout & GetDescriptorSetLayout() const
const vk::Pipeline & GetPipeline() const
const vk::PipelineLayout & GetPipelineLayout() const
PipelineKey GetPipelineKey() const
Retrieve the unique identifier for this pipeline's descriptor set layout.
ComputePipelineVK(std::weak_ptr< DeviceHolderVK > device_holder, std::weak_ptr< PipelineLibrary > library, const ComputePipelineDescriptor &desc, vk::UniquePipeline pipeline, vk::UniquePipelineLayout layout, vk::UniqueDescriptorSetLayout descriptor_set_layout, PipelineKey pipeline_key)
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: pipeline.h:52
int64_t PipelineKey
Definition: pipeline.h:21
Definition: comparable.h:95