MCPcopy Create free account
hub / github.com/PixarAnimationStudios/OpenUSD / _Compile

Method _Compile

pxr/exec/exec/leafCompilationTask.cpp:32–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30_MakeInputKeyVector(const ExecValueKey &valueKey);
31
32void
33Exec_LeafCompilationTask::_Compile(
34 Exec_CompilationState &compilationState,
35 TaskPhases &taskPhases)
36{
37 TRACE_FUNCTION();
38
39 taskPhases.Invoke(
40 // Turn the value key into an input key and create an input resolving
41 // subtask to compile the source output to later connect to the leaf node.
42 [this, &compilationState]
43 (TaskDependencies &deps) {
44 TRACE_FUNCTION_SCOPE("input compilation");
45
46 // Get the provider object from the value key
47 _originObject = _valueKey.GetProvider();
48
49 // Make an input key from the value key
50 _inputKeys = _MakeInputKeyVector(_valueKey);
51
52 // Run a new subtask to compile the input
53 deps.NewSubtask<Exec_InputResolvingCompilationTask>(
54 compilationState,
55 _inputKeys->Get()[0],
56 *_originObject,
57 EsfSchemaConfigKey(),
58 &_resultOutputs,
59 &_journal);
60 },
61
62 // Compile and connect the leaf node.
63 [this, &compilationState]
64 (TaskDependencies &deps) {
65 TRACE_FUNCTION_SCOPE("leaf node creation");
66
67 if (!TF_VERIFY(_resultOutputs.size() == 1,
68 "Expected exactly one output for value key '%s'; got '%zu'",
69 _valueKey.GetDebugName().c_str(),
70 _resultOutputs.size())) {
71 return;
72 }
73
74 const VdfMaskedOutput &sourceOutput = _resultOutputs.front();
75 if (!TF_VERIFY(sourceOutput)) {
76 return;
77 }
78
79 // Return the compiled source output as the requested leaf output
80 *_leafOutput = sourceOutput;
81
82 // If a leaf node is already compiled for this value key, then
83 // compilation is done. This happens when requests are recompiled, in
84 // which case the only purpose of LeafCompilationTask is to resolve the
85 // new leaf output.
86 if (compilationState.GetProgram()->GetCompiledLeafNode(_valueKey)) {
87 return;
88 }
89

Callers

nothing calls this directly

Calls 15

_MakeInputKeyVectorFunction · 0.85
EsfSchemaConfigKeyFunction · 0.85
GetCompiledLeafNodeMethod · 0.80
GetProgramMethod · 0.80
SetCompiledLeafNodeMethod · 0.80
InvokeMethod · 0.45
GetMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
GetDebugNameMethod · 0.45
frontMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected