Loading...
Searching...
No Matches
resourceBindings.h
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_RESOURCEBINDINGS_H
8#define PXR_IMAGING_HGI_RESOURCEBINDINGS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/buffer.h"
13#include "pxr/imaging/hgi/enums.h"
14#include "pxr/imaging/hgi/handle.h"
15#include "pxr/imaging/hgi/sampler.h"
16#include "pxr/imaging/hgi/texture.h"
17#include "pxr/imaging/hgi/types.h"
18
19#include <string>
20#include <vector>
21
22
23PXR_NAMESPACE_OPEN_SCOPE
24
25
26
27
28
63{
64 HGI_API
66
67 HgiBufferHandleVector buffers;
68 std::vector<uint32_t> offsets;
69 std::vector<uint32_t> sizes;
70 HgiBindResourceType resourceType;
71 uint32_t bindingIndex;
72 HgiShaderStage stageUsage;
73 bool writable;
74};
75using HgiBufferBindDescVector = std::vector<HgiBufferBindDesc>;
76
77HGI_API
78bool operator==(
79 const HgiBufferBindDesc& lhs,
80 const HgiBufferBindDesc& rhs);
81
82HGI_API
83bool operator!=(
84 const HgiBufferBindDesc& lhs,
85 const HgiBufferBindDesc& rhs);
86
112{
113 HGI_API
115
116 HgiTextureHandleVector textures;
117 HgiSamplerHandleVector samplers;
118 HgiBindResourceType resourceType;
119 uint32_t bindingIndex;
120 HgiShaderStage stageUsage;
121 bool writable;
122};
123using HgiTextureBindDescVector = std::vector<HgiTextureBindDesc>;
124
125HGI_API
126bool operator==(
127 const HgiTextureBindDesc& lhs,
128 const HgiTextureBindDesc& rhs);
129
130HGI_API
131bool operator!=(
132 const HgiTextureBindDesc& lhs,
133 const HgiTextureBindDesc& rhs);
134
147{
148 HGI_API
150
151 std::string debugName;
152 HgiBufferBindDescVector buffers;
153 HgiTextureBindDescVector textures;
154};
155
156HGI_API
157bool operator==(
158 const HgiResourceBindingsDesc& lhs,
159 const HgiResourceBindingsDesc& rhs);
160
161HGI_API
162bool operator!=(
163 const HgiResourceBindingsDesc& lhs,
164 const HgiResourceBindingsDesc& rhs);
165
166
174{
175public:
176 HGI_API
177 virtual ~HgiResourceBindings();
178
180 HGI_API
182
183protected:
184 HGI_API
186
187 HgiResourceBindingsDesc _descriptor;
188
189private:
190 HgiResourceBindings() = delete;
191 HgiResourceBindings & operator=(const HgiResourceBindings&) = delete;
193};
194
196using HgiResourceBindingsHandleVector = std::vector<HgiResourceBindingsHandle>;
197
212{
213 HGI_API
215 uint32_t byteOffset,
216 uint32_t index)
217 : buffer(buffer)
218 , byteOffset(byteOffset)
219 , index(index)
220 {
221 }
222
223 HgiBufferHandle buffer;
224 uint32_t byteOffset;
225 uint32_t index;
226};
227
228using HgiVertexBufferBindingVector = std::vector<HgiVertexBufferBinding>;
229
230
231PXR_NAMESPACE_CLOSE_SCOPE
232
233#endif
Represents a collection of buffers, texture and vertex attributes that will be used by an cmds object...
HGI_API HgiResourceBindingsDesc const & GetDescriptor() const
The descriptor describes the object.
Describes the binding information of a buffer (or array of buffers).
Describes a set of resources that are bound to the GPU during encoding.
Describes the binding information of a texture (or array of textures).
Describes a buffer to be bound during encoding.