7#ifndef PXR_IMAGING_HD_BUFFER_SPEC_H
8#define PXR_IMAGING_HD_BUFFER_SPEC_H
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/types.h"
18PXR_NAMESPACE_OPEN_SCOPE
21typedef std::vector<struct HdBufferSpec> HdBufferSpecVector;
39 name(name), tupleType(tupleType) {}
44 HdBufferSpecVector *bufferSpecs) {
45 for (
auto const &src : sources) {
47 src->GetBufferSpecs(bufferSpecs);
55 static bool IsSubset(HdBufferSpecVector
const &subset,
56 HdBufferSpecVector
const &superset);
63 static HdBufferSpecVector
ComputeUnion(HdBufferSpecVector
const &spec1,
64 HdBufferSpecVector
const &spec2);
71 HdBufferSpecVector
const &spec2);
75 static void Dump(HdBufferSpecVector
const &specs);
90 return name == other.name && tupleType == other.tupleType;
93 return !(*
this == other);
98 return name < other.name || (name == other.name &&
99 tupleType < other.tupleType);
107template <
class HashState>
111 h.Append(bs.name, bs.tupleType);
114PXR_NAMESPACE_CLOSE_SCOPE
Token for efficient comparison, assignment, and hashing of known strings.
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.
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.
bool operator==(HdBufferSpec const &other) const
Equality checks.
static HD_API void Dump(HdBufferSpecVector const &specs)
Debug output.
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.
HdBufferSpec(TfToken const &name, HdTupleType tupleType)
Constructor.
HD_API size_t Hash() const
Return a size_t hash for this spec.
static void GetBufferSpecs(T const &sources, HdBufferSpecVector *bufferSpecs)
Util function for adding buffer specs of sources into bufferspecs.
HdTupleType represents zero, one, or more values of the same HdType.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...