Overte C++ Documentation
Renderpass.h
1 //
2 // Created by Bradley Austin Davis on 2018/10/21
3 // Copyright 2013-2018 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 #pragma once
9 #ifndef hifi_gpu_Renderpass_h
10 #define hifi_gpu_Renderpass_h
11 
12 #include <assert.h>
13 #include <memory>
14 #include <functional>
15 #include <vector>
16 #include <string>
17 
18 #include "Format.h"
19 
20 namespace gpu {
21 
23 enum class LoadOp
24 {
25  Load = 0,
26  Clear = 1,
27  DontCare = 2,
28 };
29 
31 enum class StoreOp
32 {
33  Store = 0,
34  DontCare = 1,
35 };
36 
38 struct Attachment {
39  Attachment();
40  Attachment(const Element& element, LoadOp loadOp, StoreOp storeOp, LoadOp stencilLoadOp = LoadOp::DontCare, StoreOp stencilStoreOp = StoreOp::DontCare);
41  Element element;
42  LoadOp loadOp{ LoadOp::DontCare };
43  StoreOp storeOp{ StoreOp::DontCare };
44  LoadOp stencilLoadOp{ LoadOp::DontCare };
45  StoreOp stencilStoreOp{ StoreOp::DontCare };
46 
47  uint32_t getRaw() const;
48  void setRaw(uint32_t raw);
49 };
50 
52 class Renderpass {
53 public:
54  using Attachments = std::vector<Attachment>;
55 
56  Renderpass();
57  virtual ~Renderpass();
58 
59  void addColorAttachment(const Element& element, LoadOp load, StoreOp store);
60  void setDepthStencilAttachment(const Element& element, LoadOp load, StoreOp store, LoadOp stencilLoadOp = LoadOp::DontCare, StoreOp stencilStoreOp = StoreOp::DontCare);
61 
62 protected:
63  Attachments _colorAttachments;
64  Attachment _depthStencilAttachment;
65  // TODO if we want to start working with input attachments and multisampling resolve attachments, we'll need to extend this class
66 };
67 
68 } // namespace gpu
69 
70 #endif
Definition: Format.h:295
Not used anywhere.
Definition: Renderpass.h:52
Not used anywhere.
Definition: Renderpass.h:38