| 17 | #include "pxr/exec/ef/leafNode.h" |
| 18 | |
| 19 | PXR_NAMESPACE_OPEN_SCOPE |
| 20 | |
| 21 | void |
| 22 | Exec_InputRecompilationTask::_Compile( |
| 23 | Exec_CompilationState &compilationState, |
| 24 | TaskPhases &taskPhases) |
| 25 | { |
| 26 | taskPhases.Invoke( |
| 27 | [this, &compilationState](TaskDependencies &deps) { |
| 28 | TRACE_FUNCTION_SCOPE("recompile input"); |
| 29 | |
| 30 | // Fetch recompilation info for the input's node. |
| 31 | const Exec_NodeRecompilationInfo *const nodeRecompilationInfo = |
| 32 | compilationState.GetProgram()->GetNodeRecompilationInfo( |
| 33 | &_input->GetNode()); |
| 34 | if (!TF_VERIFY( |
| 35 | nodeRecompilationInfo, |
| 36 | "Unable to recompile input '%s' because no recompilation info was " |
| 37 | "found for the node.", |
| 38 | _input->GetDebugName().c_str())) { |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | // Fetch recompilation info specific to this input. |
| 43 | const EsfObject &originObject = nodeRecompilationInfo->GetProvider(); |
| 44 | const TfSmallVector<const Exec_InputKey *, 1> inputKeys = |
| 45 | nodeRecompilationInfo->GetInputKeys(*_input); |
| 46 | if (!TF_VERIFY( |
| 47 | !inputKeys.empty(), |
| 48 | "Unable to recompile input '%s' because no input keys were found.", |
| 49 | _input->GetDebugName().c_str())) { |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | // Each input key needs its own output vector and journal for |
| 54 | // input resolution. |
| 55 | const size_t numInputKeys = inputKeys.size(); |
| 56 | _resultOutputsPerInputKey.resize(numInputKeys); |
| 57 | _journalPerInputKey.resize(numInputKeys); |
| 58 | |
| 59 | // Re-resolve and recompile the input's dependencies. |
| 60 | for (size_t i = 0; i < numInputKeys; ++i) { |
| 61 | deps.NewSubtask<Exec_InputResolvingCompilationTask>( |
| 62 | compilationState, |
| 63 | *inputKeys[i], |
| 64 | originObject, |
| 65 | nodeRecompilationInfo->GetDispatchingSchemaKey(), |
| 66 | &_resultOutputsPerInputKey[i], |
| 67 | &_journalPerInputKey[i]); |
| 68 | } |
| 69 | }, |
| 70 | |
| 71 | [this, &compilationState](TaskDependencies &deps) { |
| 72 | TRACE_FUNCTION_SCOPE("spawn cycle detecting tasks"); |
| 73 | |
| 74 | // Spawn Exec_CycleDetectingTasks for each new node upstream of the |
| 75 | // recompiled input. If any of these nodes are also downstream of this |
| 76 | // input, then one of the Exec_CycleDetectingTasks spawned here will |
nothing calls this directly
no test coverage detected