HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
attachmentDesc.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HGI_ATTACHMENT_DESC_H
8 #define PXR_IMAGING_HGI_ATTACHMENT_DESC_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hgi/api.h"
12 #include "pxr/imaging/hgi/enums.h"
13 #include "pxr/imaging/hgi/types.h"
14 #include "pxr/base/gf/vec4f.h"
15 #include <vector>
16 
18 
19 
20 /// \struct HgiAttachmentDesc
21 ///
22 /// Describes the properties of a framebuffer attachment.
23 ///
24 /// <ul>
25 /// <li>format:
26 /// The format of the attachment.
27 /// Must match what is set in HgiTextureDesc.</li>
28 /// <li>usage:
29 /// Describes how the texture is intended to be used.
30 /// Must match what is set in HgiTextureDesc.</li>
31 /// <li>loadOp:
32 /// The operation to perform on the attachment pixel data prior to rendering.</li>
33 /// <li>storeOp:
34 /// The operation to perform on the attachment pixel data after rendering.</li>
35 /// <li>clearValue:
36 /// The value to clear the attachment with (r,g,b,a) or (depth,stencil,x,x)</li>
37 /// <li>colorMask:
38 /// Whether to permit or restrict writing to component channels.</li>
39 /// <li>blendEnabled:
40 /// Determines if a blend operation should be applied to the attachment.</li>
41 /// <li> ***BlendFactor:
42 /// The blend factors for source and destination.</li>
43 /// <li> ***BlendOp:
44 /// The blending operation.</li>
45 /// <li> blendConstantColor:
46 /// The constant color for blend operations.</li>
47 ///
49 {
52  , usage(0)
55  , clearValue(0)
58  , blendEnabled(false)
65  , blendConstantColor(0.0f, 0.0f, 0.0f, 0.0f)
66  {}
67 
82 };
83 
84 using HgiAttachmentDescVector = std::vector<HgiAttachmentDesc>;
85 
86 HGI_API
87 bool operator==(
88  const HgiAttachmentDesc& lhs,
89  const HgiAttachmentDesc& rhs);
90 
91 HGI_API
92 bool operator!=(
93  const HgiAttachmentDesc& lhs,
94  const HgiAttachmentDesc& rhs);
95 
96 HGI_API
97 std::ostream& operator<<(
98  std::ostream& out,
100 
101 
103 
104 #endif
HgiAttachmentLoadOp
Definition: enums.h:258
std::vector< HgiAttachmentDesc > HgiAttachmentDescVector
HgiBlendFactor dstAlphaBlendFactor
HgiBlendOp alphaBlendOp
HgiTextureUsage usage
HgiFormat
Definition: types.h:28
HgiBlendFactor srcColorBlendFactor
HgiBits HgiTextureUsage
Definition: enums.h:153
GLfloat f
Definition: glcorearb.h:1926
HgiAttachmentStoreOp
Definition: enums.h:278
HgiBlendFactor
Definition: enums.h:484
GfVec4f blendConstantColor
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
HgiBlendOp
Definition: enums.h:469
HGI_API std::ostream & operator<<(std::ostream &out, const HgiAttachmentDesc &attachment)
GLenum attachment
Definition: glcorearb.h:1291
HgiAttachmentStoreOp storeOp
Definition: vec4f.h:45
#define HGI_API
Definition: api.h:23
HgiColorMask colorMask
GLsizeiptr const void GLenum usage
Definition: glcorearb.h:664
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HgiBlendFactor dstColorBlendFactor
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HgiBlendOp colorBlendOp
HgiAttachmentLoadOp loadOp
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
HgiBits HgiColorMask
Definition: enums.h:521
HgiBlendFactor srcAlphaBlendFactor