All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
drawTargetAttachmentDescArray.h
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef HDST_DRAW_TARGET_ATTACHMENT_DESC_ARRAY_H
25 #define HDST_DRAW_TARGET_ATTACHMENT_DESC_ARRAY_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdSt/api.h"
29 #include "pxr/imaging/hdSt/drawTargetAttachmentDesc.h"
30 
31 #include <vector>
32 
33 PXR_NAMESPACE_OPEN_SCOPE
34 
35 
48 {
49 public:
51  HDST_API
53 
54  HDST_API
55  HdStDrawTargetAttachmentDescArray(size_t attachmentCount);
56  virtual ~HdStDrawTargetAttachmentDescArray() = default;
57 
58  HDST_API
59  HdStDrawTargetAttachmentDescArray(const HdStDrawTargetAttachmentDescArray &copy);
60  HDST_API
61  HdStDrawTargetAttachmentDescArray &operator =(const HdStDrawTargetAttachmentDescArray &copy);
62 
64  HDST_API
65  void AddAttachment(const std::string &name,
66  HdFormat format,
67  const VtValue &clearColor,
68  HdWrap wrapS,
69  HdWrap wrapT,
70  HdMinFilter minFilter,
71  HdMagFilter magFilter);
72 
73 
74  HDST_API
75  size_t GetNumAttachments() const;
76  HDST_API
77  const HdStDrawTargetAttachmentDesc &GetAttachment(size_t idx) const;
78 
80  HDST_API
81  void SetDepthSampler(HdWrap depthWrapS,
82  HdWrap depthWrapT,
83  HdMinFilter depthMinFilter,
84  HdMagFilter depthMagFilter);
85 
86 
87  HdWrap GetDepthWrapS() const { return _depthWrapS; }
88  HdWrap GetDepthWrapT() const { return _depthWrapT; }
89  HdMinFilter GetDepthMinFilter() const { return _depthMinFilter; }
90  HdMagFilter GetDepthMagFilter() const { return _depthMagFilter; }
91 
92  // Depth display properties
93  HDST_API
94  void SetDepthPriority(HdDepthPriority depthPriority);
95 
96  HdDepthPriority GetDepthPriority() const { return _depthPriority; }
97 
98 
99  // VtValue requirements
100  HDST_API
101  size_t GetHash() const;
102  HDST_API
103  void Dump(std::ostream &out) const;
104  HDST_API
105  bool operator==(const HdStDrawTargetAttachmentDescArray &other) const;
106  HDST_API
107  bool operator!=(const HdStDrawTargetAttachmentDescArray &other) const;
108 
109 private:
110  typedef std::vector<HdStDrawTargetAttachmentDesc> _AttachmentDescArray;
111 
112  _AttachmentDescArray _attachments;
113 
114  // Sampler State for Depth attachment
115  HdWrap _depthWrapS;
116  HdWrap _depthWrapT;
117  HdMinFilter _depthMinFilter;
118  HdMagFilter _depthMagFilter;
119 
120  // Depth display properties
121  HdDepthPriority _depthPriority;
122 };
123 
124 HDST_API
125 size_t hash_value(const HdStDrawTargetAttachmentDescArray &attachments);
126 HDST_API
127 std::ostream &operator <<(std::ostream &out,
129 
130 
131 PXR_NAMESPACE_CLOSE_SCOPE
132 
133 #endif // HDST_DRAW_TARGET_ATTACHMENT_DESC_ARRAY_H
Represents an render to texture render pass.
Describes all the color buffer attachments for a draw target.
HDST_API HdStDrawTargetAttachmentDescArray()
Default constructor for container purposes.
HDST_API void SetDepthSampler(HdWrap depthWrapS, HdWrap depthWrapT, HdMinFilter depthMinFilter, HdMagFilter depthMagFilter)
Sampler State for Depth attachment.
HDST_API void AddAttachment(const std::string &name, HdFormat format, const VtValue &clearColor, HdWrap wrapS, HdWrap wrapT, HdMinFilter minFilter, HdMagFilter magFilter)
Pushes a new attachment onto the end of the list of attachments.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182