Flutter Impeller
sampler_library_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_LIBRARY_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_LIBRARY_VK_H_
7 
14 
15 namespace impeller {
16 
17 class SamplerLibraryVK final
18  : public SamplerLibrary,
19  public BackendCast<SamplerLibraryVK, SamplerLibrary> {
20  public:
21  // |SamplerLibrary|
22  ~SamplerLibraryVK() override;
23 
24  SamplerLibraryVK(const std::weak_ptr<DeviceHolderVK>& device_holder,
25  uint32_t max_sampler_anisotropy);
26 
27  void ApplyWorkarounds(const WorkaroundsVK& workarounds);
28 
29  private:
30  friend class ContextVK;
31 
32  std::weak_ptr<DeviceHolderVK> device_holder_;
33  std::vector<std::pair<uint64_t, std::shared_ptr<const Sampler>>> samplers_;
34  uint32_t max_sampler_anisotropy_ = 1;
35  bool mips_disabled_workaround_ = false;
36 
37  // |SamplerLibrary|
38  raw_ptr<const Sampler> GetSampler(
39  const SamplerDescriptor& descriptor) override;
40 
41  SamplerLibraryVK(const SamplerLibraryVK&) = delete;
42 
43  SamplerLibraryVK& operator=(const SamplerLibraryVK&) = delete;
44 };
45 
46 } // namespace impeller
47 
48 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_LIBRARY_VK_H_
SamplerLibraryVK(const std::weak_ptr< DeviceHolderVK > &device_holder, uint32_t max_sampler_anisotropy)
void ApplyWorkarounds(const WorkaroundsVK &workarounds)
A wrapper around a raw ptr that adds additional unopt mode only checks.
Definition: raw_ptr.h:15
A non-exhaustive set of driver specific workarounds.