Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
render_pass_builder_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_RENDER_PASS_BUILDER_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RENDER_PASS_BUILDER_VK_H_
7
8#include <map>
9#include <optional>
10
14
15namespace impeller {
16
18 public:
20
22
24
26
29 SampleCount sample_count,
30 LoadAction load_action,
31 StoreAction store_action);
32
34 SampleCount sample_count,
35 LoadAction load_action,
36 StoreAction store_action);
37
39 SampleCount sample_count,
40 LoadAction load_action,
41 StoreAction store_action);
42
43 vk::UniqueRenderPass Build(const vk::Device& device) const;
44
45 // Visible for testing.
46 const std::map<size_t, vk::AttachmentDescription>& GetColorAttachments()
47 const;
48
49 // Visible for testing.
50 const std::map<size_t, vk::AttachmentDescription>& GetResolves() const;
51
52 // Visible for testing.
53 const std::optional<vk::AttachmentDescription>& GetDepthStencil() const;
54
55 private:
56 std::map<size_t, vk::AttachmentDescription> colors_;
57 std::map<size_t, vk::AttachmentDescription> resolves_;
58 std::optional<vk::AttachmentDescription> depth_stencil_;
59};
60
61//------------------------------------------------------------------------------
62/// @brief Inserts the appropriate barriers to ensure that subsequent
63/// commands can read from the specified image (itself a framebuffer
64/// attachment) as an input attachment.
65///
66/// Unlike most barriers, this barrier may only be inserted within a
67/// Vulkan render-pass.
68///
69/// The type of barrier inserted depends on the subpass setup and
70/// self-dependencies. Only use this utility method for inserting
71/// barriers in render passes created by `RenderPassBuilderVK`.
72///
73/// @param[in] buffer The buffer
74/// @param[in] image The image
75///
76void InsertBarrierForInputAttachmentRead(const vk::CommandBuffer& buffer,
77 const vk::Image& image);
78
79} // namespace impeller
80
81#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RENDER_PASS_BUILDER_VK_H_
RenderPassBuilderVK & SetDepthStencilAttachment(PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
const std::map< size_t, vk::AttachmentDescription > & GetColorAttachments() const
const std::map< size_t, vk::AttachmentDescription > & GetResolves() const
RenderPassBuilderVK & SetStencilAttachment(PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
const std::optional< vk::AttachmentDescription > & GetDepthStencil() const
RenderPassBuilderVK & operator=(const RenderPassBuilderVK &)=delete
RenderPassBuilderVK(const RenderPassBuilderVK &)=delete
RenderPassBuilderVK & SetColorAttachment(size_t index, PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
vk::UniqueRenderPass Build(const vk::Device &device) const
VkDevice device
Definition main.cc:53
sk_sp< SkImage > image
Definition examples.cpp:29
static const uint8_t buffer[]
uint32_t uint32_t * format
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition formats.h:100
void InsertBarrierForInputAttachmentRead(const vk::CommandBuffer &buffer, const vk::Image &image)
Inserts the appropriate barriers to ensure that subsequent commands can read from the specified image...