7 #ifndef PXR_EXEC_VDF_CONTEXT_H
8 #define PXR_EXEC_VDF_CONTEXT_H
28 #include "pxr/base/tf/mallocTag.h"
53 VdfContext(state, node, VdfScheduleTaskInvalid)
65 _invocation(invocation)
203 void Warn(
const char *fmt, ...) const ARCH_PRINTF_FUNCTION(2, 3);
222 void CodingError(const
char *fmt, ...) const ARCH_PRINTF_FUNCTION(2, 3);
239 inline const
T *_GetFirstInputValue(const
TfToken &
name) const;
248 bool _GetOutputMasks(
251 const
VdfMask **affectsMask) const;
258 bool _IsRequiredOutput(const
VdfOutput &output) const;
267 const
VdfNode &_GetNode()
const {
return _node; }
305 if (
const T *
value = _GetFirstInputValue<T>(name)) {
310 "No input value for token '%s' on node '%s'",
321 return _GetFirstInputValue<T>(
name);
328 const T *
value = _GetFirstInputValue<T>(
name);
329 return value ? value : defPtr;
347 return _GetFirstInputValue<T>(
name);
352 VdfContext::_GetFirstInputValue(
const TfToken &
name)
const
370 if (firstIndex < mask.
GetSize()) {
382 return &accessor[firstIndex];
395 const T &value)
const
397 TfAutoMallocTag2 tag(
"Vdf",
"VdfContext::SetOutput");
402 if (output && _IsRequiredOutput(*output))
403 if (
VdfVector *
v = _GetExecutor()._GetOutputValueForWriting(*output))
411 TfAutoMallocTag2 tag(
"Vdf",
"VdfContext::SetOutput");
426 TfAutoMallocTag2 tag(
"Vdf",
"VdfContext::SetOutput (move)");
435 v->Set(std::forward<T>(value));
443 TfAutoMallocTag2 tag(
"Vdf",
"VdfContext::SetOutput (move)");
448 if (output && _IsRequiredOutput(*output))
449 if (
VdfVector *
v = _GetExecutor()._GetOutputValueForWriting(*output))
450 v->Set(std::forward<T>(value));
size_t GetFirstSet() const
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
VDF_API void CodingError(const char *fmt,...) const ARCH_PRINTF_FUNCTION(2
#define PXR_NAMESPACE_OPEN_SCOPE
GLsizei const GLfloat * value
A VdfMask is placed on connections to specify the data flowing through them.
const VdfOutput * GetOutput(const TfToken &name) const
const VdfInput * GetInput(const TfToken &inputName) const
void SetOutput(const TfToken &outputName, const T &value) const
VdfByValueOrConstRef< T > GetInputValue(const TfToken &name) const
VdfContext(const VdfEvaluationState &state, const VdfNode &node, const VdfScheduleTaskIndex invocation)
virtual const VdfVector * _GetInputValue(const VdfConnection &connection, const VdfMask &mask) const =0
const T * GetInputValuePtr(const TfToken &name) const
VDF_API bool IsOutputRequested(const TfToken &outputName) const
VdfContext(const VdfEvaluationState &state, const VdfNode &node)
#define __ARCH_PRETTY_FUNCTION__
Contains a specification of how to execute a particular VdfNetwork.
VdfContext & operator=(const VdfContext &rhs)=delete
VdfExecutorErrorLogger * GetErrorLogger() const
const VdfSchedule & GetSchedule() const
VDF_API void Warn(const char *fmt,...) const ARCH_PRINTF_FUNCTION(2
const T & GetFallback() const
GLuint const GLchar * name
A node that pulls on a vector of value that are downstream of the current execution position...
bool HasInputValue(const TfToken &name) const
char const * GetText() const
VDF_API void SetOutputToReferenceInput(const TfToken &inputName) const
static VDF_API VdfExecutionTypeRegistry & GetInstance()
VdfContext(const VdfContext &rhs)=delete
virtual VdfVector * _GetOutputValueForWriting(const VdfOutput &output) const =0
ReadAccessor< TYPE > GetReadAccessor() const
const VdfExecutorInterface & GetExecutor() const
#define PXR_NAMESPACE_CLOSE_SCOPE
VDF_API std::string GetNodeDebugName() const
uint32_t VdfScheduleTaskIndex
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values...
size_t GetNumValues() const
typename std::conditional_t< std::is_pointer_v< T >||Vdf_AndTypeIsSmall< T, std::is_arithmetic_v< T >>||Vdf_AndTypeIsSmall< T, std::is_enum_v< T >>, T, const T & > VdfByValueOrConstRef
VDF_API void SetEmptyOutput() const