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);
80 static HdBufferSpecVector
ComputeUnion(HdBufferSpecVector
const &spec1,
81 HdBufferSpecVector
const &spec2);
88 HdBufferSpecVector
const &spec2);
92 static void Dump(HdBufferSpecVector
const &specs);
107 return name == other.name && tupleType == other.tupleType;
110 return !(*
this == other);
115 return name < other.name || (name == other.name &&
116 tupleType < other.tupleType);
124 template <
class HashState>
128 h.Append(bs.name, bs.tupleType);
131 PXR_NAMESPACE_CLOSE_SCOPE
133 #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 unordered sets, maps.
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.
bool operator<(HdBufferSpec const &other) const
Ordering.
bool operator==(HdBufferSpec const &other) const
Equality checks.
static void GetBufferSpecs(T const &sources, HdBufferSpecVector *bufferSpecs)
Util function for adding buffer specs of sources into bufferspecs.
HdBufferSpec(TfToken const &name, HdTupleType tupleType)
Constructor.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...