Loading...
Searching...
No Matches
poolChainIndex.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_POOL_CHAIN_INDEX_H
8#define PXR_EXEC_VDF_POOL_CHAIN_INDEX_H
9
11
12#include "pxr/pxr.h"
13
14#include "pxr/exec/vdf/api.h"
15#include "pxr/exec/vdf/output.h"
16
17PXR_NAMESPACE_OPEN_SCOPE
18
19
24{
25public:
26 bool operator<(VdfPoolChainIndex rhs) const
27 {
28 return _index < rhs._index;
29 }
30
31 bool operator<=(VdfPoolChainIndex rhs) const
32 {
33 return !(rhs < *this);
34 }
35
36 bool operator>(VdfPoolChainIndex rhs) const
37 {
38 return rhs < *this;
39 }
40
41 bool operator>=(VdfPoolChainIndex rhs) const
42 {
43 return !(*this < rhs);
44 }
45
46 bool operator==(VdfPoolChainIndex rhs) const
47 {
48 return _index == rhs._index;
49 }
50
51 bool operator!=(VdfPoolChainIndex rhs) const
52 {
53 return !(*this == rhs);
54 }
55
56private:
57 friend class VdfPoolChainIndexer;
58 VdfPoolChainIndex(int poolChainIndex, uint32_t outputIndex)
59 // Combine the pool chain and output indices into a single field.
60 //
61 // The combined index should be sorted primarily in pool chain order.
62 // The invalid pool chain index is -1 so we increment the pool chain
63 // index to ensure that the previous implementation's order, which put
64 // invalid entries first, is maintained.
65 : _index(((static_cast<size_t>(poolChainIndex)+1) << 32ull) |
66 outputIndex)
67 {}
68
69private:
70 size_t _index;
71};
72
73
77inline bool
79{
80 return output.GetAssociatedInput() && output.GetNumDataEntries() > 1;
81}
82
83PXR_NAMESPACE_CLOSE_SCOPE
84
85#endif
A VdfOutput represents an output on a node.
Definition: output.h:32
VDF_API int GetNumDataEntries() const
Returns the expected number of entries in the data computed at this output.
const VdfInput * GetAssociatedInput() const
Returns the in/out connector associated with this output.
Definition: output.h:76
Opaque pool chain index type.
bool Vdf_IsPoolOutput(const VdfOutput &output)
Returns true if output is a pool output, i.e., an output that has an associated input,...