| Flutter Impeller |

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/pipeline_vk.h"
6
7 namespace impeller {
8
9 PipelineVK::PipelineVK(std::weak_ptr<DeviceHolder> device_holder,
10 std::weak_ptr<PipelineLibrary> library,
11 const PipelineDescriptor& desc,
12 vk::UniquePipeline pipeline,
13 vk::UniqueRenderPass render_pass,
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 render_pass_(std::move(render_pass)),
20 layout_(std::move(layout)),
21 descriptor_set_layout_(std::move(descriptor_set_layout)) {
22 is_valid_ = pipeline_ && render_pass_ && layout_ && descriptor_set_layout_;
23 }
24
25 PipelineVK::~PipelineVK() {
26 std::shared_ptr<DeviceHolder> device_holder = device_holder_.lock();
27 if (device_holder) {
28 descriptor_set_layout_.reset();
29 layout_.reset();
30 render_pass_.reset();
31 pipeline_.reset();
32 } else {
33 descriptor_set_layout_.release();
34 layout_.release();
35 render_pass_.release();
36 pipeline_.release();
37 }
38 }
39
40 bool PipelineVK::IsValid() const {
41 return is_valid_;
42 }
43
44 const vk::Pipeline& PipelineVK::GetPipeline() const {
45 return *pipeline_;
46 }
47
48 const vk::RenderPass& PipelineVK::GetRenderPass() const {
49 return *render_pass_;
50 }
51
52 const vk::PipelineLayout& PipelineVK::GetPipelineLayout() const {
53 return *layout_;
54 }
55
56 const vk::DescriptorSetLayout& PipelineVK::GetDescriptorSetLayout() const {
57 return *descriptor_set_layout_;
58 }
59
60 } // namespace impeller
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:30
impeller::Pipeline
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: compute_pipeline_descriptor.h:27
impeller::PipelineVK::GetRenderPass
const vk::RenderPass & GetRenderPass() const
Definition: pipeline_vk.cc:48
impeller::PipelineVK::~PipelineVK
~PipelineVK() override
Definition: pipeline_vk.cc:25
impeller::PipelineVK::GetPipelineLayout
const vk::PipelineLayout & GetPipelineLayout() const
Definition: pipeline_vk.cc:52
impeller::PipelineVK::GetPipeline
const vk::Pipeline & GetPipeline() const
Definition: pipeline_vk.cc:44
pipeline_vk.h
impeller::PipelineVK::PipelineVK
PipelineVK(std::weak_ptr< DeviceHolder > device_holder, std::weak_ptr< PipelineLibrary > library, const PipelineDescriptor &desc, vk::UniquePipeline pipeline, vk::UniqueRenderPass render_pass, vk::UniquePipelineLayout layout, vk::UniqueDescriptorSetLayout descriptor_set_layout)
Definition: pipeline_vk.cc:9
std
Definition: comparable.h:98
impeller::PipelineVK::GetDescriptorSetLayout
const vk::DescriptorSetLayout & GetDescriptorSetLayout() const
Definition: pipeline_vk.cc:56
impeller
Definition: aiks_context.cc:10