| 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 : Pipeline(std::move(library), desc),
17 device_holder_(std::move(device_holder)),
18 pipeline_(std::move(pipeline)),
19 layout_(std::move(layout)),
20 descriptor_set_layout_(std::move(descriptor_set_layout)) {
21 is_valid_ = pipeline_ && layout_ && descriptor_set_layout_;
22 }
23
24 ComputePipelineVK::~ComputePipelineVK() {
25 std::shared_ptr<DeviceHolderVK> device_holder = device_holder_.lock();
26 if (device_holder) {
27 descriptor_set_layout_.reset();
28 layout_.reset();
29 pipeline_.reset();
30 } else {
31 descriptor_set_layout_.release();
32 layout_.release();
33 pipeline_.release();
34 }
35 }
36
37 bool ComputePipelineVK::IsValid() const {
38 return is_valid_;
39 }
40
41 const vk::Pipeline& ComputePipelineVK::GetPipeline() const {
42 return *pipeline_;
43 }
44
45 const vk::PipelineLayout& ComputePipelineVK::GetPipelineLayout() const {
46 return *layout_;
47 }
48
49 const vk::DescriptorSetLayout& ComputePipelineVK::GetDescriptorSetLayout()
50 const {
51 return *descriptor_set_layout_;
52 }
53
54 } // namespace impeller
impeller::Pipeline
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: compute_pipeline_descriptor.h:18
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:20
impeller::ComputePipelineVK::GetPipelineLayout
const vk::PipelineLayout & GetPipelineLayout() const
Definition: compute_pipeline_vk.cc:45
impeller::ComputePipelineVK::~ComputePipelineVK
~ComputePipelineVK() override
Definition: compute_pipeline_vk.cc:24
compute_pipeline_vk.h
impeller::ComputePipelineVK::GetDescriptorSetLayout
const vk::DescriptorSetLayout & GetDescriptorSetLayout() const
Definition: compute_pipeline_vk.cc:49
std
Definition: comparable.h:95
impeller::ComputePipelineVK::GetPipeline
const vk::Pipeline & GetPipeline() const
Definition: compute_pipeline_vk.cc:41
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)
Definition: compute_pipeline_vk.cc:9
impeller
Definition: allocation.cc:12