All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
resourceBindings.h
1 //
2 // Copyright 2020 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 PXR_IMAGING_HGI_RESOURCEBINDINGS_H
25 #define PXR_IMAGING_HGI_RESOURCEBINDINGS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hgi/api.h"
29 #include "pxr/imaging/hgi/buffer.h"
30 #include "pxr/imaging/hgi/enums.h"
31 #include "pxr/imaging/hgi/handle.h"
32 #include "pxr/imaging/hgi/sampler.h"
33 #include "pxr/imaging/hgi/texture.h"
34 #include "pxr/imaging/hgi/types.h"
35 
36 #include <string>
37 #include <vector>
38 
39 
40 PXR_NAMESPACE_OPEN_SCOPE
41 
42 
43 
44 
45 
71 {
72  HGI_API
74 
75  HgiBufferHandleVector buffers;
76  std::vector<uint32_t> offsets;
77  HgiBindResourceType resourceType;
78  uint32_t bindingIndex;
79  HgiShaderStage stageUsage;
80 };
81 using HgiBufferBindDescVector = std::vector<HgiBufferBindDesc>;
82 
83 HGI_API
84 bool operator==(
85  const HgiBufferBindDesc& lhs,
86  const HgiBufferBindDesc& rhs);
87 
88 HGI_API
89 inline bool operator!=(
90  const HgiBufferBindDesc& lhs,
91  const HgiBufferBindDesc& rhs);
92 
116 {
117  HGI_API
119 
120  HgiTextureHandleVector textures;
121  HgiSamplerHandleVector samplers;
122  HgiBindResourceType resourceType;
123  uint32_t bindingIndex;
124  HgiShaderStage stageUsage;
125 };
126 using HgiTextureBindDescVector = std::vector<HgiTextureBindDesc>;
127 
128 HGI_API
129 bool operator==(
130  const HgiTextureBindDesc& lhs,
131  const HgiTextureBindDesc& rhs);
132 
133 HGI_API
134 bool operator!=(
135  const HgiTextureBindDesc& lhs,
136  const HgiTextureBindDesc& rhs);
137 
150 {
151  HGI_API
153 
154  std::string debugName;
155  HgiBufferBindDescVector buffers;
156  HgiTextureBindDescVector textures;
157 };
158 
159 HGI_API
160 bool operator==(
161  const HgiResourceBindingsDesc& lhs,
162  const HgiResourceBindingsDesc& rhs);
163 
164 HGI_API
165 bool operator!=(
166  const HgiResourceBindingsDesc& lhs,
167  const HgiResourceBindingsDesc& rhs);
168 
169 
177 {
178 public:
179  HGI_API
180  virtual ~HgiResourceBindings();
181 
183  HGI_API
184  HgiResourceBindingsDesc const& GetDescriptor() const;
185 
186 protected:
187  HGI_API
189 
190  HgiResourceBindingsDesc _descriptor;
191 
192 private:
193  HgiResourceBindings() = delete;
194  HgiResourceBindings & operator=(const HgiResourceBindings&) = delete;
195  HgiResourceBindings(const HgiResourceBindings&) = delete;
196 };
197 
199 using HgiResourceBindingsHandleVector = std::vector<HgiResourceBindingsHandle>;
200 
201 
202 PXR_NAMESPACE_CLOSE_SCOPE
203 
204 #endif
HGI_API HgiResourceBindingsDesc const & GetDescriptor() const
The descriptor describes the object.
AR_API bool operator!=(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
AR_API bool operator==(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
Represents a collection of buffers, texture and vertex attributes that will be used by an cmds object...
Describes the binding information of a buffer (or array of buffers).
Describes the binding information of a texture (or array of textures).
Describes a set of resources that are bound to the GPU during encoding.