Flutter Engine
The Flutter Engine
swapchain_transients_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_SWAPCHAIN_SWAPCHAIN_TRANSIENTS_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_SWAPCHAIN_TRANSIENTS_VK_H_
7
11
12namespace impeller {
13
14//------------------------------------------------------------------------------
15/// @brief Resources, meant to be memoized by the texture descriptor of the
16/// wrapped swapchain images, that are intuitively cheap to create
17/// but have been observed to be time consuming to construct on some
18/// Vulkan drivers. This includes the device-transient MSAA and
19/// depth-stencil textures.
20///
21/// The same textures are used for all swapchain images.
22///
24 public:
25 explicit SwapchainTransientsVK(std::weak_ptr<Context> context,
27 bool enable_msaa);
28
30
32
34
35 const std::weak_ptr<Context>& GetContext() const;
36
37 bool IsMSAAEnabled() const;
38
39 const std::shared_ptr<Texture>& GetMSAATexture();
40
41 const std::shared_ptr<Texture>& GetDepthStencilTexture();
42
43 private:
44 std::weak_ptr<Context> context_;
45 const TextureDescriptor desc_;
46 const bool enable_msaa_;
47 std::shared_ptr<Texture> cached_msaa_texture_;
48 std::shared_ptr<Texture> cached_depth_stencil_;
49
50 std::shared_ptr<Texture> CreateMSAATexture() const;
51
52 std::shared_ptr<Texture> CreateDepthStencilTexture() const;
53};
54
55} // namespace impeller
56
57#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_SWAPCHAIN_TRANSIENTS_VK_H_
Resources, meant to be memoized by the texture descriptor of the wrapped swapchain images,...
const std::weak_ptr< Context > & GetContext() const
const std::shared_ptr< Texture > & GetMSAATexture()
SwapchainTransientsVK & operator=(const SwapchainTransientsVK &)=delete
SwapchainTransientsVK(const SwapchainTransientsVK &)=delete
const std::shared_ptr< Texture > & GetDepthStencilTexture()
SwapchainTransientsVK(std::weak_ptr< Context > context, TextureDescriptor desc, bool enable_msaa)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...