HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vector.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 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_EXEC_VDF_VECTOR_H
8 #define PXR_EXEC_VDF_VECTOR_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
16 #include "pxr/exec/vdf/mask.h"
24 
25 #include "pxr/base/arch/hints.h"
26 #include "pxr/base/tf/diagnostic.h"
28 #include "pxr/base/vt/value.h"
29 
30 #include <iosfwd>
31 #include <new>
32 #include <type_traits>
33 #include <typeinfo>
34 #include <vector>
35 
37 
38 template <typename T>
40 
41 /// \class VdfVector
42 ///
43 /// This class is used to abstract away knowledge of the cache data used for
44 /// each node.
45 ///
46 /// Note that data can be put into a VdfVector only atomically, no incremental
47 /// adding of elements is possible.
48 ///
49 /// Note that Vdf requires the availability of the default and copy constructor
50 /// for the given template parameter TYPE. Additional Vdf provides default
51 /// fallback values via the VdfExecutionTypeRegistry. That is to give types the
52 /// ability to have empty default constructors (for speed) but at the same time
53 /// have well definied values to use in case we need to provide a "default".
54 ///
55 class VdfVector
56 {
57 public:
58 
59  /// Copy constructor.
60  ///
61  VdfVector(const VdfVector &rhs)
62  {
63  // We need to new an empty impl because Clone() always expects
64  // a valid _data to clone into.
65  rhs._data.Get()->NewEmpty(0, &_data);
66  rhs._data.Get()->Clone(&_data);
67  }
68 
69  /// Copy constructor with subset copying.
70  ///
72  const VdfVector &rhs,
73  const VdfMask &mask)
74  {
75  // CloneSubset expects valid _data to copy into, so first create
76  // an empty vector.
77  rhs._data.Get()->NewEmpty(0, &_data);
78 
79  // If the mask is all ones, take advange of the potentially faster
80  // Clone() method.
81  if (mask.IsAllOnes()) {
82  rhs._data.Get()->Clone(&_data);
83  } else if (mask.IsAnySet()) {
84  rhs._data.Get()->CloneSubset(mask, &_data);
85  }
86  }
87 
88  /// Copy constructor with boxing.
89  ///
92  };
93 
95  const VdfVector &rhs,
96  const VdfMask &mask,
98  {
99  if (rhs.GetSize() != mask.GetSize()) {
101  "size mismatch: rhs.GetSize() (%zu) != mask.GetSize() (%zu)",
102  rhs.GetSize(), mask.GetSize());
103  }
104 
105  // Box expects valid _data to copy into, so first create an
106  // empty vector.
107  rhs._data.Get()->NewEmpty(0, &_data);
108  if (mask.IsAnySet()) {
109  rhs._data.Get()->Box(mask.GetBits(), &_data);
110  }
111  }
112 
113  /// Construct a vector with the same element type as \p rhs and of size
114  /// \p size. All elements in this new vector are default constructed.
115  ///
117  const VdfVector &rhs,
118  size_t size)
119  {
120  if (size == 0) {
121  rhs._data.Get()->NewEmpty(0, &_data);
122  } else if (size == 1){
123  rhs._data.Get()->NewSingle(&_data);
124  } else{
125  rhs._data.Get()->NewDense(size, &_data);
126  }
127  }
128 
129  /// Move constructor.
130  ///
132  {
133  rhs._data.Get()->NewEmpty(0, &_data);
134  rhs._data.Get()->MoveInto(&_data);
135  }
136 
137  /// Destructor.
138  ///
140  {
141  _data.Destroy();
142  }
143 
144  /// Returns the number of elements held in this vector.
145  ///
146  size_t GetSize() const { return _data.Get()->GetSize(); }
147 
148  /// Returns whether or not this vector is empty.
149  ///
150  bool IsEmpty() const { return GetSize() == 0; }
151 
152  /// Returns the number of elements for which this vector has storage.
153  ///
154  size_t GetNumStoredElements() const
155  {
156  return _data.Get()->GetNumStoredElements();
157  }
158 
159  /// Forwards \p data into the vector.
160  ///
161  template<typename TYPE>
162  void Set(TYPE &&data)
163  {
164  // We need to decay because TYPE is deduced as T& when l-values are
165  // passed and T may also be cv-qualified. This decayed type is what
166  // is held by the underlying vector impl that provides storage.
167  using T = typename std::decay<TYPE>::type;
168 
169  _CheckType<T>();
170  _data.Destroy();
171  _data.New<Vdf_VectorImplSingle<T>>(std::forward<TYPE>(data));
172  }
173 
174  /// Copy boxed values into the vector.
175  ///
176  template <typename TYPE>
178  {
179  _CheckType<TYPE>();
180  _data.Destroy();
182  }
183  // Unfortunately, we have to provide overloads for all combinations of
184  // const-qualification & reference category due to the unconstrained Set
185  // overload. Everything other than non-const rvalue reference gets
186  // copied.
187  //
188  template <typename TYPE>
190  {
191  const Vdf_BoxedContainer<TYPE> &cdata = data;
192  this->Set(cdata);
193  }
194  template <typename TYPE>
196  {
197  const Vdf_BoxedContainer<TYPE> &cdata = data;
198  this->Set(cdata);
199  }
200 
201  /// Move boxed values into the vector.
202  ///
203  template <typename TYPE>
205  {
206  _CheckType<TYPE>();
207  _data.Destroy();
209  }
210 
211  /// Allocates space for \p size number of elements.
212  ///
213  /// The vector will be initialized with the default ctor. Note that if this
214  /// doesn't do anything meaningful (cf. Gf types), memory will be left
215  /// uninitialized.
216  ///
217  template<typename TYPE>
218  void Resize(size_t size)
219  {
220  _CheckType<TYPE>();
221 
222  _data.Destroy();
223 
224  // Note that we never construct a compressed vector impl, here. The
225  // purpose of this function is to resize the vector to be able to
226  // accommodate all the data denoted in \p mask, but we do not support
227  // merging data into a compressed vector without first uncompressing.
228 
229  if (size == 0)
231  else if (size == 1)
233  else
235  }
236 
237  /// Allocates space for the elements denoted by \p bits.
238  ///
239  /// The vector will be initialized with the default ctor. Note that if this
240  /// doesn't do anything meaningful (cf. Gf types), memory will be left
241  /// uninitialized.
242  ///
243  template<typename TYPE>
244  void Resize(const VdfMask::Bits &bits)
245  {
246  _CheckType<TYPE>();
247 
248  _data.Destroy();
249 
250  // Note that we never construct a compressed vector impl, here. The
251  // purpose of this function is to resize the vector to be able to
252  // accommodate all the data denoted in \p bits, but we do not support
253  // merging data into a compressed vector without first uncompressing.
254 
255  const size_t size = bits.GetSize();
256 
257  if (size == 0)
259  else if (size == 1)
261  else if (bits.AreAllUnset())
263  else
265  }
266 
267  /// Destroys contents of this vector.
268  ///
269  /// Resets the vector to have zero size but maintains the held type.
270  ///
271  VDF_API
272  void Clear();
273 
274  /// Copies the contents of \p rhs into this vector.
275  ///
276  /// \p rhs and this vector must be type compatible.
277  ///
278  /// Use this instead of operator= when you want to take advantage of
279  /// only copying the elements set in \p mask from the \p rhs vector.
280  ///
281  void Copy(const VdfVector &rhs, const VdfMask &mask)
282  {
283  _CheckType(rhs);
284 
285  // Need to detach local data before copying into it if we are shared.
286  if (ARCH_UNLIKELY(_data.Get()->GetInfo().ownership ==
289  }
290 
291  // If the mask is all ones, take advange of the potentially faster
292  // Clone() method.
293  if (mask.IsAllOnes()) {
294  rhs._data.Get()->Clone(&_data);
295  }
296 
297  else if (mask.IsAnySet()) {
298  rhs._data.Get()->CloneSubset(mask, &_data);
299  }
300 
301  // If the mask is all zeros, create an empty vector instead of
302  // duplicating the rhs vector's implementation with an empty data
303  // section. For compressed vectors, for example, this would cause
304  // problems, because the index mapping would remain uninitialized,
305  // essentially leaving the implementation in a broken state.
306  else {
307  _data.Destroy();
308  rhs._data.Get()->NewEmpty(mask.GetSize(), &_data);
309  }
310  }
311 
312  /// Merges the contents of \p rhs into this vector. The elements copied
313  /// from \p rhs are determined by the \p mask.
314  ///
315  /// \p rhs and this vector must be type compatible. Also note, that this
316  /// vector (the destination vector), must NOT be a compressed vector.
317  ///
318  VDF_API
319  void Merge(const VdfVector &rhs, const VdfMask::Bits &bits);
320 
321  /// Same as Merge(), but takes a VdfMask instead of a bitset.
322  ///
323  void Merge(const VdfVector &rhs, const VdfMask &mask) {
324  Merge(rhs, mask.GetBits());
325  }
326 
327  /// Embeds the current vector's existing implementaion into a reference
328  /// counted implementaion so that the data can be shared without copying.
329  /// Mutating the contents of the data holder once shared will cause
330  /// detachment. Returns true if the sharing was successful.
331  ///
332  /// Note: This method is not thread safe.
333  ///
334  bool Share() const
335  {
336  // Bail out if not sharable
337  if (!_data.Get()->IsSharable()) {
338  return false;
339  }
340 
341  // Create the new shared impl in a temp DataHolder, _data is moved
342  // into and held by a SharedSource.
345 
346  // Move the new shared data into this vector's DataHolder.
347  tmp.Get()->MoveInto(&_data);
348  tmp.Destroy();
349 
350  return true;
351  }
352 
353  /// Returns \c true if the vector has been shared.
354  ///
355  /// Note: Only used in tests currently.
356  ///
357  bool IsShared() const
358  {
359  return _data.Get()->GetInfo().ownership ==
361  }
362 
363  /// Returns \c true if the vector can be shared.
364  ///
365  bool IsSharable() const
366  {
367  return _data.Get()->IsSharable();
368  }
369 
370  /// Extracts this vector's values into a VtArray<T>.
371  ///
372  /// If the data has been shared previously, no copying occurs. Otherwise,
373  /// the data is copied into a new VtArray.
374  ///
375  template <typename T>
376  VtArray<T>
377  ExtractAsVtArray(const size_t size, const int offset) const
378  {
380  const Vdf_VectorData::Info& info = data->GetInfo();
381 
383  return _DecompressAsVtArray(
384  reinterpret_cast<T *>(info.data),
385  *info.compressedIndexMapping, size, offset);
386  }
387 
388  // Need to get a typed pointer to the first element. The memory layout
389  // depends on if the vector is boxed or not. This is what
390  // Vdf_VectorAccessor does under the hood to provide element access.
391  T *access;
393  using BoxedVectorType = Vdf_BoxedContainer<T>;
394  access = reinterpret_cast<BoxedVectorType *>(info.data)->data();
395  } else {
396  access = reinterpret_cast<T *>(info.data) - info.first;
397  }
398 
399  access += offset;
400 
403  : VtArray<T>(access, access + size);
404  }
405 
406  /// A read/write accessor for low-level access to the contents
407  /// of the VdfVector.
408  ///
409  template < typename TYPE >
411  public:
412 
413  /// Default constructor.
414  ///
415  ReadWriteAccessor() = default;
416 
417  /// Returns \c true of the vector is empty.
418  ///
419  bool IsEmpty() const { return _accessor.IsEmpty(); }
420 
421  /// Returns the size of the vector, i.e. the nu,ber of values it holds.
422  ///
423  size_t GetNumValues() const { return _accessor.GetNumValues(); }
424 
425  /// Returns \c true if this accessor is providing element-wise access
426  /// into a boxed container.
427  ///
428  bool IsBoxed() const { return _accessor.IsBoxed(); }
429 
430  /// Returns a mutable reference to an element.
431  ///
432  TYPE &operator[](size_t i) const { return _accessor[i]; }
433 
434  private:
435 
436  // Only VdfVector is allowed to create instances of this class.
437  friend class VdfVector;
438 
439  // The constructor used by VdfVector.
442  const Vdf_VectorData::Info &info) :
443  _accessor(data, info)
444  {}
445 
446  // The underlying accessor type.
447  Vdf_VectorAccessor<TYPE> _accessor;
448 
449  };
450 
451  /// GetReadWriteAccessor() allows low level access to the content of the
452  /// VdfVector via the Vdf_VectorData base class. In order to get the handle
453  /// to that this method will do the correct type checking for you.
454  ///
455  template<typename TYPE>
457  {
458  Vdf_VectorData::Info info = _data.Get()->GetInfo();
459 
460  if (ARCH_UNLIKELY(info.ownership ==
462 
464 
465  // Update the info after detaching.
466  info = _data.Get()->GetInfo();
467  }
468 
469  return ReadWriteAccessor<TYPE>(_data.Get(), info);
470  }
471 
472  /// A read-only accessor for low-level acces to the contents of the
473  /// VdfVector.
474  ///
475  template <typename TYPE>
476  class ReadAccessor {
477  public:
478 
479  /// Default constructor.
480  ///
481  ReadAccessor() = default;
482 
483  /// Returns \c true if the vector is empty.
484  ///
485  bool IsEmpty() const { return _accessor.IsEmpty(); }
486 
487  /// Returns the size of the vector, i.e. the number of values it holds.
488  ///
489  size_t GetNumValues() const { return _accessor.GetNumValues(); }
490 
491  /// Returns \c true if this accessor is providing element-wise access
492  /// into a boxed container.
493  ///
494  bool IsBoxed() const { return _accessor.IsBoxed(); }
495 
496  /// Returns a const reference to an element.
497  ///
498  const TYPE& operator[](size_t i) const { return _accessor[i]; }
499 
500  private:
501 
502  // Only VdfVector is allowed to create instances of this class.
503  friend class VdfVector;
504 
505  // The constructor used by VdfVector.
506  ReadAccessor(
508  const Vdf_VectorData::Info& info):
509  _accessor(data, info)
510  {}
511 
512  // The underlying accessor type.
513  Vdf_VectorAccessor<TYPE> _accessor;
514  };
515 
516  /// GetReadAccessor() allows low level read-only access to the content of
517  /// of the VdfVector via the Vdf_VectorData base class. In order to get the
518  /// handle to that, this method will do the correct type checking for you.
519  ///
520  template <typename TYPE>
522  {
523  return ReadAccessor<TYPE>(_data.Get(), _data.Get()->GetInfo());
524  }
525 
526  /// Provide read-only access to the boxed subranges held by this vector.
527  ///
528  /// While this is a public method, only VdfSubrangeView can make use of
529  /// the returned Vdf_VectorSubrangeAccessor.
530  ///
531  template <typename TYPE>
533  {
535  _data.Get(), _data.Get()->GetInfo());
536  }
537 
538  /// Checks if a vector holds a specific type.
539  ///
540  template<typename TYPE>
541  bool Holds() const
542  {
543  static_assert(
544  !Vdf_IsBoxedContainer<TYPE>,
545  "VdfVector::Holds cannot check for boxed-ness");
546 
547  return TfSafeTypeCompare(_GetTypeInfo(), typeid(TYPE));
548  }
549 
550  /// Copies the content of \p rhs into this vector. This is an expensive
551  /// operation if rhs has not been shared.
552  ///
553  /// This method does runtime type checking to ensure that both vectors
554  /// have compatible types.
555  ///
557  {
558  if (&rhs == this)
559  return *this;
560 
561  _CheckType(rhs);
562 
563  rhs._data.Get()->Clone(&_data);
564 
565  return *this;
566  }
567 
568  /// Moves the content of \p rhs into this vector.
569  ///
570  /// This method does runtime type checking to ensure that both vectors
571  /// have compatible types.
572  ///
574  {
575  if (&rhs == this)
576  return *this;
577 
578  _CheckType(rhs);
579 
580  rhs._data.Get()->MoveInto(&_data);
581 
582  return *this;
583  }
584 
585  /// Returns the number of bytes necessary to store a single element of
586  /// this VdfVector.
587  ///
588  /// Note that this method estimates the allocated memory, which may not be
589  /// accurate if the held data is not a value type, or has fields that are
590  /// not value types.
591  ///
592  size_t EstimateElementMemory() const
593  {
594  return _data.Get()->EstimateElementMemory();
595  }
596 
597  /// An ostream-able object wrapping a VdfVector instance, as well as a mask
598  /// indicating which elements in the wrapped vector should be streamed out.
599  ///
600  /// Note that this class only outputs meaningful information if the object
601  /// held by the VdfVector implements the ostream operator. For types that
602  /// do not support the ostream operator, the type name will be printed
603  /// instead.
604  ///
606  public:
607 
608  /// Ostream operator.
609  ///
610  VDF_API
611  friend std::ostream &operator<<(std::ostream &, const DebugPrintable &);
612 
613  private:
614 
615  // Only VdfVector is allowed to create instances of this class.
616  friend class VdfVector;
617 
618  // Constructor.
619  DebugPrintable(const Vdf_VectorData *data, const VdfMask &mask) :
620  _data(data), _mask(mask)
621  {}
622 
623  // The vector to be printed.
624  const Vdf_VectorData *_data;
625 
626  // The mask denoting which elements in the vector should be printed.
627  const VdfMask _mask;
628 
629  };
630 
631  /// Returns an ostream-able object, which can be used to debug print the
632  /// contents of this VdfVector, filtered by \p mask.
633  ///
635  {
636  return DebugPrintable(_data.Get(), mask);
637  }
638 
639 // -----------------------------------------------------------------------------
640 
641 protected:
642 
643  // Constructs an empty VdfVector. Note that publicly we're only allowed
644  // to create a VdfTypedVector. See also
645  // VdfExecutionTypeRegistry::CreateEmptyVector(const TfType&).
646  //
648  {
649  // We rely on VdfTypedVector to make an empty data of the correct
650  // type for the default construction case.
651  }
652 
653 private:
654 
655  // Helper for ExtractAsVtArray.
656  //
657  // Decompresses the contents of a compressed vector into a VtArray.
658  // Compressed vectors are always copied because they're never sharable.
659  template <typename T>
660  static VtArray<T> _DecompressAsVtArray(
661  const T* const access,
662  const Vdf_CompressedIndexMapping &indexMapping,
663  const size_t size,
664  const int offset) {
665 
666  VtArray<T> array;
667 
668  // This is not a general purpose compressed vector copy. VtArray
669  // extraction requests a contiguous range of logical indices and we
670  // assume that this cannot span multiple blocks of data.
671  if (size_t dataIdx; _ComputeCompressedExtractionIndex(
672  indexMapping, size, offset, &dataIdx)) {
673  const T* const src = access + dataIdx;
674  array.assign(src, src+size);
675  }
676  return array;
677  }
678 
679  // Computes the data index into a compressed vector impl for the logical
680  // offset.
681  //
682  // Returns true if (offset, size) is contained in a single block of data
683  // and a valid index was written to *dataIdx. Otherwise, returns false.
684  VDF_API
685  static bool _ComputeCompressedExtractionIndex(
686  const Vdf_CompressedIndexMapping &indexMapping,
687  size_t size,
688  int offset,
689  size_t *dataIdx);
690 
691  // Helper function that delivers an error message when type checking fails.
692  VDF_API
693  static void _PostTypeError(
694  const std::type_info &thisTypeInfo,
695  const std::type_info &otherTypeInfo);
696 
697  void _CheckType(
698  const std::type_info &otherTypeInfo) const
699  {
700  const std::type_info &thisTypeInfo = _GetTypeInfo();
701  if (!TfSafeTypeCompare(thisTypeInfo, otherTypeInfo)) {
702  _PostTypeError(thisTypeInfo, otherTypeInfo);
703  }
704  }
705 
706  void _CheckType(const VdfVector &rhs) const
707  {
708  _CheckType(rhs._GetTypeInfo());
709  }
710 
711  template <typename TYPE>
712  void _CheckType() const
713  {
714  _CheckType(typeid(TYPE));
715  }
716 
717  const std::type_info &_GetTypeInfo() const
718  {
719  return _data.Get()->GetTypeInfo();
720  }
721 
722 protected:
723 
724  // Holder of the actual implementation of Vdf_VectorData that holds this
725  // vector's data. This is protected so that it can be initialized from
726  // our only derived class VdfTypedVector.
728 };
729 
731 
732 #endif
type
Definition: core.h:556
size_t GetNumValues() const
DebugPrintable GetDebugPrintable(const VdfMask &mask) const
Definition: vector.h:634
void Set(TYPE &&data)
Definition: vector.h:162
void Set(const Vdf_BoxedContainer< TYPE > &&data)
Definition: vector.h:195
bool IsEmpty() const
Definition: vector.h:150
ReadWriteAccessor< TYPE > GetReadWriteAccessor() const
Definition: vector.h:456
void Set(Vdf_BoxedContainer< TYPE > &&data)
Definition: vector.h:204
bool IsEmpty() const
void Set(Vdf_BoxedContainer< TYPE > &data)
Definition: vector.h:189
size_t GetSize() const
Definition: vector.h:146
GLboolean * data
Definition: glcorearb.h:131
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Vdf_CompressedIndexMapping * compressedIndexMapping
Definition: vectorData.h:205
VdfVector(const VdfVector &rhs)
Definition: vector.h:61
#define TF_CODING_ERROR
VdfVector(VdfVector &&rhs)
Definition: vector.h:131
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
bool IsAnySet() const
Definition: mask.h:216
size_t EstimateElementMemory() const
Definition: vector.h:592
#define VDF_API
Definition: api.h:25
Abstract base class for storing data in a VdfVector.
Definition: vectorData.h:26
virtual Info GetInfo()=0
Vdf_VectorSubrangeAccessor< TYPE > GetSubrangeAccessor() const
Definition: vector.h:532
VdfMask::Bits const & GetBits() const
Definition: mask.h:556
Fast, compressed bit array which is capable of performing logical operations without first decompress...
Implements a Vdf_VectorData storage the supports reference counted sharing of other vector implementa...
VtArray< T > ExtractAsVtArray(const size_t size, const int offset) const
Definition: vector.h:377
#define ARCH_UNLIKELY(x)
Definition: hints.h:30
ConstructBoxedCopyTag
Definition: vector.h:90
GLintptr offset
Definition: glcorearb.h:665
void Copy(const VdfVector &rhs, const VdfMask &mask)
Definition: vector.h:281
Vdf_VectorData::DataHolder _data
Definition: vector.h:727
VdfVector(const VdfVector &rhs, const VdfMask &mask)
Definition: vector.h:71
bool Share() const
Definition: vector.h:334
GLuint GLint GLboolean GLint GLenum access
Definition: glcorearb.h:2222
bool IsShared() const
Definition: vector.h:357
TYPE & operator[](size_t i) const
Definition: vector.h:432
VDF_API friend std::ostream & operator<<(std::ostream &, const DebugPrintable &)
GLint GLuint mask
Definition: glcorearb.h:124
VDF_API void Merge(const VdfVector &rhs, const VdfMask::Bits &bits)
virtual VDF_API Vt_ArrayForeignDataSource * GetSharedSource() const
Definition: types.h:152
bool AreAllUnset() const
VdfVector(const VdfVector &rhs, const VdfMask &mask, ConstructBoxedCopyTag)
Definition: vector.h:94
bool IsBoxed() const
Definition: vector.h:428
Implements a Vdf_VectorData storage that holds a boxed element.
size_t GetNumStoredElements() const
Definition: vector.h:154
VdfVector & operator=(const VdfVector &rhs)
Definition: vector.h:556
VdfVector & operator=(VdfVector &&rhs)
Definition: vector.h:573
size_t GetSize() const
Definition: mask.h:158
VdfVector()
Definition: vector.h:647
void Resize(const VdfMask::Bits &bits)
Definition: vector.h:244
GLsizeiptr size
Definition: glcorearb.h:664
size_t GetSize() const
ReadAccessor< TYPE > GetReadAccessor() const
Definition: vector.h:521
bool IsBoxed() const
Implements a Vdf_VectorData storage that is always empty.
Base const * Get() const
Returns a Base pointer to the held instance.
~VdfVector()
Definition: vector.h:139
size_t GetNumValues() const
Definition: vector.h:423
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool IsEmpty() const
Definition: vector.h:419
void Merge(const VdfVector &rhs, const VdfMask &mask)
Definition: vector.h:323
bool IsBoxed() const
Definition: vector.h:494
Implements a Vdf_VectorData storage that is holds a single element.
const TYPE & operator[](size_t i) const
Definition: vector.h:498
PXR_NAMESPACE_OPEN_SCOPE bool TfSafeTypeCompare(const std::type_info &t1, const std::type_info &t2)
bool IsAllOnes() const
Definition: mask.h:196
static VDF_API void Detach(Vdf_VectorData::DataHolder *data)
size_t GetNumValues() const
Definition: vector.h:489
bool IsEmpty() const
Definition: vector.h:485
bool Holds() const
Definition: vector.h:541
void Set(const Vdf_BoxedContainer< TYPE > &data)
Definition: vector.h:177
bool IsSharable() const
Definition: vector.h:365
Definition: format.h:1821
VDF_API void Clear()
VdfVector(const VdfVector &rhs, size_t size)
Definition: vector.h:116
void Resize(size_t size)
Definition: vector.h:218
GLenum src
Definition: glcorearb.h:1793