HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VEX_VexResolver Class Referenceabstract

#include <VEX_VexResolver.h>

+ Inheritance diagram for VEX_VexResolver:

Static Public Member Functions

static bool needsVexResolver (const char *shader)
 
static bool needsVexResolverForMantraOutput (const char *shader)
 
static bool getVflCode (const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags=VEX_CG_DEFAULT, int context_type=0, VEX_ErrorLog *errors=nullptr)
 
static bool getVexCode (const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags=VEX_CG_DEFAULT, int context_type=0, bool *is_pure_compiled_out=nullptr, VEX_ErrorLog *errors=nullptr)
 
static bool getDependencies (const char *shader, UT_StringArray &shader_dependencies, int context_type=0)
 
static bool addDependency (const char *shader, DEP_MicroNode *depmicronode)
 
static int getCodeTimeStamp (const char *shader, int context_type=0)
 
static void getEmptyVexCode (const char *shader, std::ostream &os)
 
static bool getVexContext (const char *shader, UT_String &ctx, int requested_context_type=0, VEX_ErrorLog *errors=nullptr)
 
static bool convertToCanonicalPath (const char *shader, UT_String &canonical_shader)
 
static bool convertAlias (const char *alias, UT_String &shader)
 
static bool cacheVexCode (const char *shader, int context_type=0, VEX_ErrorLog *errors=nullptr)
 

Protected Member Functions

 VEX_VexResolver ()
 
virtual ~VEX_VexResolver ()
 
virtual bool canResolveCode (const char *shader)=0
 
virtual bool supportedByMantra (const char *shader)=0
 
virtual bool resolveVflCode (const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags, int context_type)=0
 
virtual bool resolveVexCode (const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags, int context_type, bool &is_pure_compiled_out, VEX_ErrorLog &errors)=0
 See comments for getVexCode(). More...
 
virtual bool resolveCacheVexCode (const char *shader, int context_type, VEX_ErrorLog &errors)=0
 
virtual bool resolveDependencies (const char *shader, UT_StringArray &shader_deps, int context_type)=0
 
virtual bool resolveAddDependency (const char *shader, DEP_MicroNode *depmicronode)=0
 
virtual int resolveCodeTimeStamp (const char *shader, int context_type)=0
 
virtual bool resolveVexContext (const char *shader, UT_String &ctx, int requested_context_type)=0
 
virtual bool resolveCanonicalPath (const char *shader, UT_String &canonical_shader)=0
 
virtual bool resolveAlias (const char *alias, UT_String &shader)=0
 

Detailed Description

Definition at line 44 of file VEX_VexResolver.h.

Constructor & Destructor Documentation

VEX_VexResolver::VEX_VexResolver ( )
protected
virtual VEX_VexResolver::~VEX_VexResolver ( )
protectedvirtual

Member Function Documentation

static bool VEX_VexResolver::addDependency ( const char *  shader,
DEP_MicroNode depmicronode 
)
static

Marks a given micronode as dependent on our code. It will be dirtied whenever the generating VOPs change.

static bool VEX_VexResolver::cacheVexCode ( const char *  shader,
int  context_type = 0,
VEX_ErrorLog errors = nullptr 
)
static

Resolves the shader & adds it to the cache, returning true if successfully cached.

virtual bool VEX_VexResolver::canResolveCode ( const char *  shader)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

static bool VEX_VexResolver::convertAlias ( const char *  alias,
UT_String shader 
)
static

Resolves the alias to a proper shader name. Sometimes, a shader may be referred to using its function name as alias rather than operator name as is the convention for resolving code.

static bool VEX_VexResolver::convertToCanonicalPath ( const char *  shader,
UT_String canonical_shader 
)
static

Resolvers may support relative paths in the shader string. Sometimes, however, you'll want to use the shader string as an identifier. For example, you might want to cache the resolved result. To safely do so you'll need a canonical string with the relative paths resolved. This method performs this conversion, returning true and setting the output string only when some resolution had to be performed.

static int VEX_VexResolver::getCodeTimeStamp ( const char *  shader,
int  context_type = 0 
)
static
static bool VEX_VexResolver::getDependencies ( const char *  shader,
UT_StringArray shader_dependencies,
int  context_type = 0 
)
static

Returns a list of shaders that the given shader depends on. This is usually a list of encapsulated shaders that can be shared among multiple shader instances.

static void VEX_VexResolver::getEmptyVexCode ( const char *  shader,
std::ostream &  os 
)
static
static bool VEX_VexResolver::getVexCode ( const char *  shader,
std::ostream &  os,
VEX_CodeGenFlags  code_flags = VEX_CG_DEFAULT,
int  context_type = 0,
bool *  is_pure_compiled_out = nullptr,
VEX_ErrorLog errors = nullptr 
)
static

Obtains an object (vex) shader code in os for the given shader name and for the given context type. If provided, pure_compiled_out will be true for shaders from fully compiled code-only operators or HDAs. If provided, warnings_or_errors will be filled with messages; if no issues were encountered it will be empty; if there are warnings it will contain them (but the method will return true); if there are errors it will contain them and the method will return false. Returns true if a valid vex code has been obtained (though, note there may still be some warnings in the outgoing argument). Returns false if vex could not be obtained.

static bool VEX_VexResolver::getVexContext ( const char *  shader,
UT_String ctx,
int  requested_context_type = 0,
VEX_ErrorLog errors = nullptr 
)
static
static bool VEX_VexResolver::getVflCode ( const char *  shader,
std::ostream &  os,
VEX_CodeGenFlags  code_flags = VEX_CG_DEFAULT,
int  context_type = 0,
VEX_ErrorLog errors = nullptr 
)
static
static bool VEX_VexResolver::needsVexResolver ( const char *  shader)
static
static bool VEX_VexResolver::needsVexResolverForMantraOutput ( const char *  shader)
static
virtual bool VEX_VexResolver::resolveAddDependency ( const char *  shader,
DEP_MicroNode depmicronode 
)
protectedpure virtual

Marks a given micronode as dependent on our code. It will be dirtied whenever the generating VOPs change.

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveAlias ( const char *  alias,
UT_String shader 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveCacheVexCode ( const char *  shader,
int  context_type,
VEX_ErrorLog errors 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveCanonicalPath ( const char *  shader,
UT_String canonical_shader 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual int VEX_VexResolver::resolveCodeTimeStamp ( const char *  shader,
int  context_type 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveDependencies ( const char *  shader,
UT_StringArray shader_deps,
int  context_type 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveVexCode ( const char *  shader,
std::ostream &  os,
VEX_CodeGenFlags  code_flags,
int  context_type,
bool &  is_pure_compiled_out,
VEX_ErrorLog errors 
)
protectedpure virtual

See comments for getVexCode().

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveVexContext ( const char *  shader,
UT_String ctx,
int  requested_context_type 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::resolveVflCode ( const char *  shader,
std::ostream &  os,
VEX_CodeGenFlags  code_flags,
int  context_type 
)
protectedpure virtual

Implemented in STY_VexResolver, and VOP_CodeVexResolver.

virtual bool VEX_VexResolver::supportedByMantra ( const char *  shader)
protectedpure virtual

Returns true when mantra is able to independently retrieve the VEX shader code without requiring it to be embedded in the ifd.

Implemented in STY_VexResolver, and VOP_CodeVexResolver.


The documentation for this class was generated from the following file: