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
23
PXR_NAMESPACE_OPEN_SCOPE
24
25
26
27
28
62
struct
HgiBufferBindDesc
63
{
64
HGI_API
65
HgiBufferBindDesc
();
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
};
75
using
HgiBufferBindDescVector = std::vector<HgiBufferBindDesc>;
76
77
HGI_API
78
bool
operator==(
79
const
HgiBufferBindDesc
& lhs,
80
const
HgiBufferBindDesc
& rhs);
81
82
HGI_API
83
bool
operator!=(
84
const
HgiBufferBindDesc
& lhs,
85
const
HgiBufferBindDesc
& rhs);
86
111
struct
HgiTextureBindDesc
112
{
113
HGI_API
114
HgiTextureBindDesc
();
115
116
HgiTextureHandleVector textures;
117
HgiSamplerHandleVector samplers;
118
HgiBindResourceType resourceType;
119
uint32_t bindingIndex;
120
HgiShaderStage stageUsage;
121
bool
writable;
122
};
123
using
HgiTextureBindDescVector = std::vector<HgiTextureBindDesc>;
124
125
HGI_API
126
bool
operator==(
127
const
HgiTextureBindDesc
& lhs,
128
const
HgiTextureBindDesc
& rhs);
129
130
HGI_API
131
bool
operator!=(
132
const
HgiTextureBindDesc
& lhs,
133
const
HgiTextureBindDesc
& rhs);
134
146
struct
HgiResourceBindingsDesc
147
{
148
HGI_API
149
HgiResourceBindingsDesc
();
150
151
std::string debugName;
152
HgiBufferBindDescVector buffers;
153
HgiTextureBindDescVector textures;
154
};
155
156
HGI_API
157
bool
operator==(
158
const
HgiResourceBindingsDesc
& lhs,
159
const
HgiResourceBindingsDesc
& rhs);
160
161
HGI_API
162
bool
operator!=(
163
const
HgiResourceBindingsDesc
& lhs,
164
const
HgiResourceBindingsDesc
& rhs);
165
166
173
class
HgiResourceBindings
174
{
175
public
:
176
HGI_API
177
virtual
~HgiResourceBindings
();
178
180
HGI_API
181
HgiResourceBindingsDesc
const
&
GetDescriptor
()
const
;
182
183
protected
:
184
HGI_API
185
HgiResourceBindings
(
HgiResourceBindingsDesc
const
& desc);
186
187
HgiResourceBindingsDesc
_descriptor;
188
189
private
:
190
HgiResourceBindings
() =
delete
;
191
HgiResourceBindings
& operator=(
const
HgiResourceBindings
&) =
delete
;
192
HgiResourceBindings
(
const
HgiResourceBindings
&) =
delete
;
193
};
194
195
using
HgiResourceBindingsHandle
=
HgiHandle<HgiResourceBindings>
;
196
using
HgiResourceBindingsHandleVector = std::vector<HgiResourceBindingsHandle>;
197
211
struct
HgiVertexBufferBinding
212
{
213
HGI_API
214
HgiVertexBufferBinding
(
HgiBufferHandle
const
&buffer,
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
228
using
HgiVertexBufferBindingVector = std::vector<HgiVertexBufferBinding>;
229
230
231
PXR_NAMESPACE_CLOSE_SCOPE
232
233
#endif
HgiHandle< HgiResourceBindings >
HgiResourceBindings
Represents a collection of buffers, texture and vertex attributes that will be used by an cmds object...
Definition
resourceBindings.h:174
HgiResourceBindings::GetDescriptor
HGI_API HgiResourceBindingsDesc const & GetDescriptor() const
The descriptor describes the object.
pxr.h
HgiBufferBindDesc
Describes the binding information of a buffer (or array of buffers).
Definition
resourceBindings.h:63
HgiResourceBindingsDesc
Describes a set of resources that are bound to the GPU during encoding.
Definition
resourceBindings.h:147
HgiTextureBindDesc
Describes the binding information of a texture (or array of textures).
Definition
resourceBindings.h:112
HgiVertexBufferBinding
Describes a buffer to be bound during encoding.
Definition
resourceBindings.h:212
pxr
imaging
hgi
resourceBindings.h
© Copyright 2026, Pixar Animation Studios. |
Terms of Use
| Generated on Fri Jun 5 2026 12:57:27 by
1.12.0