-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpipeline_barriers.h
More file actions
62 lines (47 loc) · 1.62 KB
/
pipeline_barriers.h
File metadata and controls
62 lines (47 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright (c) 2019-2020, Arm Limited and Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 the "License";
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "common/utils.h"
#include "rendering/render_pipeline.h"
#include "scene_graph/components/camera.h"
#include "vulkan_sample.h"
/**
* @brief Using pipeline barriers efficiently
*/
class PipelineBarriers : public vkb::VulkanSample
{
public:
PipelineBarriers();
virtual ~PipelineBarriers() = default;
virtual bool prepare(vkb::Platform &platform) override;
private:
enum DependencyType : int
{
BOTTOM_TO_TOP,
FRAG_TO_VERT,
FRAG_TO_FRAG
};
vkb::sg::Camera *camera{nullptr};
std::unique_ptr<vkb::RenderTarget> create_render_target(vkb::core::Image &&swapchain_image);
virtual void prepare_render_context() override;
void draw(vkb::CommandBuffer &command_buffer, vkb::RenderTarget &render_target) override;
virtual void draw_gui() override;
vkb::RenderPipeline gbuffer_pipeline;
vkb::RenderPipeline lighting_pipeline;
DependencyType dependency_type{DependencyType::BOTTOM_TO_TOP};
};
std::unique_ptr<vkb::VulkanSample> create_pipeline_barriers();