24 #ifndef PXR_IMAGING_HD_BUFFER_SPEC_H
25 #define PXR_IMAGING_HD_BUFFER_SPEC_H
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/imaging/hd/types.h"
35 PXR_NAMESPACE_OPEN_SCOPE
38 typedef std::vector<struct HdBufferSpec> HdBufferSpecVector;
56 name(name), tupleType(tupleType) {}
61 HdBufferSpecVector *bufferSpecs) {
62 for (
auto const &src : sources) {
64 src->GetBufferSpecs(bufferSpecs);
72 static bool IsSubset(HdBufferSpecVector
const &subset,
73 HdBufferSpecVector
const &superset);
78 static HdBufferSpecVector
ComputeUnion(HdBufferSpecVector
const &spec1,
79 HdBufferSpecVector
const &spec2);
85 HdBufferSpecVector
const &spec2);
89 static void Dump(HdBufferSpecVector
const &specs);
104 return name == other.name && tupleType == other.tupleType;
107 return !(*
this == other);
112 return name < other.name || (name == other.name &&
113 tupleType < other.tupleType);
121 template <
class HashState>
125 h.Append(bs.name, bs.tupleType);
128 PXR_NAMESPACE_CLOSE_SCOPE
130 #endif // PXR_IMAGING_HD_BUFFER_SPEC_H
HD_API size_t Hash() const
Return a size_t hash for this spec.
HdTupleType represents zero, one, or more values of the same HdType.
static HD_API void Dump(HdBufferSpecVector const &specs)
Debug output.
static HD_API HdBufferSpecVector ComputeDifference(HdBufferSpecVector const &spec1, HdBufferSpecVector const &spec2)
Returns difference set of spec1 and spec2, i.e., entries in spec1 that are not in spec2...
Functor to use for unorderd sets, maps.
bool operator==(HdBufferSpec const &other) const
Equality checks.
Describes each named resource of buffer array.
static HD_API bool IsSubset(HdBufferSpecVector const &subset, HdBufferSpecVector const &superset)
Returns true if subset is a subset of superset.
Token for efficient comparison, assignment, and hashing of known strings.
static HD_API HdBufferSpecVector ComputeUnion(HdBufferSpecVector const &spec1, HdBufferSpecVector const &spec2)
Returns union set of spec1 and spec2.
static void GetBufferSpecs(T const &sources, HdBufferSpecVector *bufferSpecs)
Util function for adding buffer specs of sources into bufferspecs.
bool operator<(HdBufferSpec const &other) const
Ordering.
HdBufferSpec(TfToken const &name, HdTupleType tupleType)
Constructor.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...