| Flutter Impeller |

shader_function_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/shader_function_vk.h"
6
7 namespace impeller {
8
9 ShaderFunctionVK::ShaderFunctionVK(
10 const std::weak_ptr<DeviceHolder>& device_holder,
11 UniqueID parent_library_id,
12 std::string name,
13 ShaderStage stage,
14 vk::UniqueShaderModule module)
15 : ShaderFunction(parent_library_id, std::move(name), stage),
16 module_(std::move(module)),
17 device_holder_(device_holder) {}
18
19 ShaderFunctionVK::~ShaderFunctionVK() {
20 std::shared_ptr<DeviceHolder> device_holder = device_holder_.lock();
21 if (device_holder) {
22 module_.reset();
23 } else {
24 module_.release();
25 }
26 }
27
28 const vk::ShaderModule& ShaderFunctionVK::GetModule() const {
29 return module_.get();
30 }
31
32 } // namespace impeller
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:22
impeller::ShaderFunctionVK::GetModule
const vk::ShaderModule & GetModule() const
Definition: shader_function_vk.cc:28
impeller::ShaderFunctionVK::~ShaderFunctionVK
~ShaderFunctionVK() override
Definition: shader_function_vk.cc:19
std
Definition: comparable.h:95
shader_function_vk.h
impeller
Definition: aiks_context.cc:10