Loading...
Searching...
No Matches
system.h
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_EXEC_SYSTEM_H
8#define PXR_EXEC_EXEC_SYSTEM_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/exec/exec/api.h"
13
14#include "pxr/exec/esf/stage.h"
15
16#include <memory>
17#include <utility>
18#include <vector>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
22class EfTime;
23class Exec_Program;
25class Exec_RequestTracker;
26class Exec_Runtime;
27class ExecValueKey;
28class SdfPath;
29class TfToken;
30template <typename> class TfFunctionRef;
31template <typename> class TfSpan;
32class VdfMaskedOutput;
33class VdfRequest;
34class VdfSchedule;
35
44{
45public:
47 class Diagnostics;
48
49protected:
51 EXEC_API
52 explicit ExecSystem(EsfStage &&stage);
53
54 ExecSystem(const ExecSystem &) = delete;
55 ExecSystem& operator=(const ExecSystem &) = delete;
56
57 EXEC_API
59
66 EXEC_API
67 void _ChangeTime(const EfTime &time);
68
72 EXEC_API
74 const VdfSchedule &schedule,
75 const VdfRequest &computeRequest);
76
83 EXEC_API
85 TfFunctionRef<void(Exec_RequestImpl&)> f) const;
86
88 class _ChangeProcessor;
89
90private:
91 // Requires access to _Compute, _Compile, and _HasPendingRecompilation.
92 friend class Exec_RequestImpl;
93 std::vector<VdfMaskedOutput> _Compile(TfSpan<const ExecValueKey> valueKeys);
94
95 // Returns true if the program has inputs requiring recompilation.
96 EXEC_API
97 bool _HasPendingRecompilation() const;
98
99 // Discards all internal state, and constructs new internal data structures
100 // leaving the system in the same state as if it was newly constructed.
101 //
102 EXEC_API
103 void _InvalidateAll();
104
105 // Notifies the system of invalidation due to uncompilation.
106 EXEC_API
107 void _InvalidateDisconnectedInputs();
108
109 // Notifies the system of attribute value invalidation.
110 EXEC_API
111 void _InvalidateAttributeValues(TfSpan<const SdfPath> invalidAttributes);
112
113 // Notifies the system of metadata value invalidation.
114 EXEC_API
115 void _InvalidateMetadataValues(
116 TfSpan<const std::pair<SdfPath, TfToken>> invalidObjects);
117
118private:
119 EsfStage _stage;
120
121 std::unique_ptr<Exec_Program> _program;
122 std::unique_ptr<Exec_Runtime> _runtime;
123
124 std::unique_ptr<Exec_RequestTracker> _requestTracker;
125};
126
127PXR_NAMESPACE_CLOSE_SCOPE
128
129#endif
A class that represents a point in time for execution.
Definition: time.h:37
Holds an implementation of EsfStageInterface in a fixed-size buffer.
Definition: stage.h:108
Contains data structures necessary to implement exec requests that are independent of scene descripti...
Definition: requestImpl.h:47
Public API to deliver scene changes from ExecSystem derived classes.
Utility class with various diagnostic functions for ExecSystem.
Base implementation of a system to procedurally compute values based on scene description and computa...
Definition: system.h:44
EXEC_API void _ChangeTime(const EfTime &time)
Changes time on the system.
EXEC_API void _ParallelForEachRequest(TfFunctionRef< void(Exec_RequestImpl &)> f) const
Invoke f on each outstanding exec request.
EXEC_API ExecSystem(EsfStage &&stage)
Construct an exec system for computing values on stage.
EXEC_API void _Compute(const VdfSchedule &schedule, const VdfRequest &computeRequest)
Computes the values in the computeRequest using the provided schedule.
Specifies a computed value.
Definition: valueKey.h:29
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:19
Represents a range of contiguous elements.
Definition: span.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:32
Contains a specification of how to execute a particular VdfNetwork.
Definition: schedule.h:41