Berserk
RHIRenderPass.hpp
Go to the documentation of this file.
1 /**********************************************************************************/
2 /* This file is part of Berserk Engine project */
3 /* https://github.com/EgorOrachyov/Berserk */
4 /**********************************************************************************/
5 /* MIT License */
6 /* */
7 /* Copyright (c) 2018 - 2021 Egor Orachyov */
8 /* */
9 /* Permission is hereby granted, free of charge, to any person obtaining a copy */
10 /* of this software and associated documentation files (the "Software"), to deal */
11 /* in the Software without restriction, including without limitation the rights */
12 /* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13 /* copies of the Software, and to permit persons to whom the Software is */
14 /* furnished to do so, subject to the following conditions: */
15 /* */
16 /* The above copyright notice and this permission notice shall be included in all */
17 /* copies or substantial portions of the Software. */
18 /* */
19 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20 /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21 /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22 /* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25 /* SOFTWARE. */
26 /**********************************************************************************/
27 
28 #ifndef BERSERK_RHIRENDERPASS_HPP
29 #define BERSERK_RHIRENDERPASS_HPP
30 
31 #include <core/Config.hpp>
32 #include <core/Typedefs.hpp>
33 #include <platform/Window.hpp>
34 #include <rhi/RHIFramebuffer.hpp>
35 #include <rhi/RHIResource.hpp>
36 
37 #include <vector>
38 
40 
52 };
53 
61 };
62 
67 struct RHIViewport {
68  int32 left = 0;
72 };
73 
79 public:
81  std::vector<RHIColorAttachment> colorAttachments;
82 
85 
88 
91 
94 };
95 
101 public:
103  std::vector<Vec4f> clearColors;
104  float depthClear = 1.0f;
106 };
107 
112 class RHIRenderPass : public RHIResource {
113 public:
114  BRK_API ~RHIRenderPass() override = default;
115 
117  const RHIRenderPassDesc &GetDesc() const { return mDesc; }
118 
119 protected:
122 };
123 
129 
130 #endif//BERSERK_RHIRENDERPASS_HPP
#define BRK_NS_END
Definition: Config.hpp:48
#define BRK_API
Definition: Config.hpp:32
std::int32_t int32
Definition: Typedefs.hpp:43
std::uint32_t uint32
Definition: Typedefs.hpp:44
RHI pass info to begin (initial targets clear values)
Definition: RHIRenderPass.hpp:100
float depthClear
Definition: RHIRenderPass.hpp:104
uint32 stencilClear
Definition: RHIRenderPass.hpp:105
std::vector< Vec4f > clearColors
Definition: RHIRenderPass.hpp:103
RHIViewport viewport
Definition: RHIRenderPass.hpp:102
Full render pass descriptor.
Definition: RHIRenderPass.hpp:78
StringName name
Definition: RHIRenderPass.hpp:87
Ref< Window > window
Definition: RHIRenderPass.hpp:93
std::vector< RHIColorAttachment > colorAttachments
Definition: RHIRenderPass.hpp:81
Ref< RHIFramebuffer > framebuffer
Definition: RHIRenderPass.hpp:90
RHIDepthStencilAttachment depthStencilAttachment
Definition: RHIRenderPass.hpp:84
Compiled render pass object.
Definition: RHIRenderPass.hpp:112
BRK_API ~RHIRenderPass() override=default
const RHIRenderPassDesc & GetDesc() const
Definition: RHIRenderPass.hpp:117
RHIRenderPassDesc mDesc
Definition: RHIRenderPass.hpp:121
Base class for RHI resource.
Definition: RHIResource.hpp:55
Cached shared utf-8 string id.
Definition: StringName.hpp:61
RHIRenderTargetOption
Definition: RHIDefs.hpp:302
Definition: GLDevice.cpp:46
Single render target color attachment descriptor.
Definition: RHIRenderPass.hpp:50
RHIRenderTargetOption option
Definition: RHIRenderPass.hpp:51
Depth-stencil render target attachment descriptor.
Definition: RHIRenderPass.hpp:58
RHIRenderTargetOption stencilOption
Definition: RHIRenderPass.hpp:60
RHIRenderTargetOption depthOption
Definition: RHIRenderPass.hpp:59
Area of the render target to draw.
Definition: RHIRenderPass.hpp:67
uint32 width
Definition: RHIRenderPass.hpp:70
int32 left
Definition: RHIRenderPass.hpp:68
int32 bottom
Definition: RHIRenderPass.hpp:69
uint32 height
Definition: RHIRenderPass.hpp:71