| Flutter Impeller |

sampler_vk.h
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 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
7
8 #include "impeller/base/backend_cast.h"
9 #include "impeller/core/sampler.h"
10 #include "impeller/renderer/backend/vulkan/shared_object_vk.h"
11 #include "impeller/renderer/backend/vulkan/vk.h"
12
13 namespace impeller {
14
15 class SamplerLibraryVK;
16 class YUVConversionVK;
17
18 class SamplerVK final : public Sampler, public BackendCast<SamplerVK, Sampler> {
19 public:
20 SamplerVK(const vk::Device& device,
21 const SamplerDescriptor&,
22 std::shared_ptr<YUVConversionVK> yuv_conversion = {});
23
24 // |Sampler|
25 ~SamplerVK() override;
26
27 vk::Sampler GetSampler() const;
28
29 std::shared_ptr<SamplerVK> CreateVariantForConversion(
30 std::shared_ptr<YUVConversionVK> conversion) const;
31
32 const std::shared_ptr<YUVConversionVK>& GetYUVConversion() const;
33
34 private:
35 friend SamplerLibraryVK;
36
37 const vk::Device device_;
38 SharedHandleVK<vk::Sampler> sampler_;
39 std::shared_ptr<YUVConversionVK> yuv_conversion_;
40 bool mips_disabled_workaround_ = false;
41 bool is_valid_ = false;
42
43 SamplerVK(const SamplerVK&) = delete;
44
45 SamplerVK& operator=(const SamplerVK&) = delete;
46 };
47
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_
backend_cast.h
impeller::BackendCast
Definition: backend_cast.h:11
impeller::Sampler
Definition: sampler.h:12
impeller::SamplerLibraryVK
Definition: sampler_library_vk.h:19
impeller::SamplerVK
Definition: sampler_vk.h:18
impeller::SamplerVK::GetSampler
vk::Sampler GetSampler() const
Definition: sampler_vk.cc:114
impeller::SamplerVK::~SamplerVK
~SamplerVK() override
impeller::SamplerVK::SamplerVK
SamplerVK(const vk::Device &device, const SamplerDescriptor &, std::shared_ptr< YUVConversionVK > yuv_conversion={})
Definition: sampler_vk.cc:101
impeller::SamplerVK::CreateVariantForConversion
std::shared_ptr< SamplerVK > CreateVariantForConversion(std::shared_ptr< YUVConversionVK > conversion) const
Definition: sampler_vk.cc:118
impeller::SamplerVK::GetYUVConversion
const std::shared_ptr< YUVConversionVK > & GetYUVConversion() const
Definition: sampler_vk.cc:126
impeller
Definition: allocation.cc:12
impeller::SharedHandleVK
std::shared_ptr< SharedObjectVKT< T > > SharedHandleVK
Definition: shared_object_vk.h:53
sampler.h
shared_object_vk.h
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
vk.h