| 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
5 #include "impeller/renderer/backend/vulkan/compute_pipeline_vk.h"
6
7 namespace impeller {
8
9 ComputePipelineVK::ComputePipelineVK(
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
26 ComputePipelineVK::~ComputePipelineVK() {
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
56 PipelineKey ComputePipelineVK::GetPipelineKey() const {
57 return pipeline_key_;
58 }
59
60 } // namespace impeller
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:21
impeller::ComputePipelineVK::GetDescriptorSetLayout
const vk::DescriptorSetLayout & GetDescriptorSetLayout() const
Definition: compute_pipeline_vk.cc:51
impeller::ComputePipelineVK::~ComputePipelineVK
~ComputePipelineVK() override
Definition: compute_pipeline_vk.cc:26
impeller::ComputePipelineVK::GetPipeline
const vk::Pipeline & GetPipeline() const
Definition: compute_pipeline_vk.cc:43
impeller::ComputePipelineVK::GetPipelineLayout
const vk::PipelineLayout & GetPipelineLayout() const
Definition: compute_pipeline_vk.cc:47
impeller::ComputePipelineVK::GetPipelineKey
PipelineKey GetPipelineKey() const
Retrieve the unique identifier for this pipeline's descriptor set layout.
Definition: compute_pipeline_vk.cc:56
impeller::ComputePipelineVK::ComputePipelineVK
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)
Definition: compute_pipeline_vk.cc:9
impeller::Pipeline
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: pipeline.h:52
compute_pipeline_vk.h
impeller
Definition: allocation.cc:12
impeller::PipelineKey
int64_t PipelineKey
Definition: pipeline.h:21
std
Definition: comparable.h:95