HDK
|
#include <glslfx.h>
Public Member Functions | |
HIO_API | HioGlslfx () |
Create an invalid glslfx object. More... | |
HIO_API | HioGlslfx (std::string const &filePath, TfToken const &technique=HioGlslfxTokens->defVal) |
Create a glslfx object from a file. More... | |
HIO_API | HioGlslfx (std::istream &is, TfToken const &technique=HioGlslfxTokens->defVal) |
Create a glslfx object from a stream. More... | |
HIO_API HioGlslfxConfig::Parameters | GetParameters () const |
Return the parameters specified in the configuration. More... | |
HIO_API HioGlslfxConfig::Textures | GetTextures () const |
Return the textures specified in the configuration. More... | |
HIO_API HioGlslfxConfig::Attributes | GetAttributes () const |
Return the attributes specified in the configuration. More... | |
HIO_API HioGlslfxConfig::MetadataDictionary | GetMetadata () const |
Return the metadata specified in the configuration. More... | |
HIO_API bool | IsValid (std::string *reason=NULL) const |
Returns true if this is a valid glslfx file. More... | |
HIO_API VtDictionary | GetLayoutAsDictionary (const TfTokenVector &shaderStageKeys, std::string *errorStr) const |
HIO_API std::string | GetSource (const TfToken &shaderStageKey) const |
Get the shader source associated with given key. More... | |
const std::string & | GetFilePath () const |
Get the original file name passed to the constructor. More... | |
const std::set< std::string > & | GetFiles () const |
size_t | GetHash () const |
Return the computed hash value based on the string. More... | |
Access to commonly used shader sources. | |
HIO_API std::string | GetSurfaceSource () const |
Get the surface source string. More... | |
HIO_API std::string | GetDisplacementSource () const |
Get the displacement source string. More... | |
HIO_API std::string | GetVolumeSource () const |
Get the volume source string. More... | |
Static Public Member Functions | |
static HIO_API std::vector < std::string > | ExtractImports (const std::string &filename) |
A class representing the config and shader source of a glslfx file.
a HioGlslfx object is constructed by providing the path of a file whose contents look something like this:
HIO_API HioGlslfx::HioGlslfx | ( | ) |
Create an invalid glslfx object.
HIO_API HioGlslfx::HioGlslfx | ( | std::string const & | filePath, |
TfToken const & | technique = HioGlslfxTokens->defVal |
||
) |
Create a glslfx object from a file.
HIO_API HioGlslfx::HioGlslfx | ( | std::istream & | is, |
TfToken const & | technique = HioGlslfxTokens->defVal |
||
) |
Create a glslfx object from a stream.
|
static |
Extract imported files from the specified glslfx file. The returned paths are as-authored, in the order of declaration, with possible duplicates. This function is not recursive – it only extracts imports from the specified filename
.
HIO_API HioGlslfxConfig::Attributes HioGlslfx::GetAttributes | ( | ) | const |
Return the attributes specified in the configuration.
HIO_API std::string HioGlslfx::GetDisplacementSource | ( | ) | const |
Get the displacement source string.
|
inline |
|
inline |
|
inline |
HIO_API VtDictionary HioGlslfx::GetLayoutAsDictionary | ( | const TfTokenVector & | shaderStageKeys, |
std::string * | errorStr | ||
) | const |
Get the layout config as a VtDictionary parsed from the JSON layout config corresponding to the shader source associated with the given keys.
HIO_API HioGlslfxConfig::MetadataDictionary HioGlslfx::GetMetadata | ( | ) | const |
Return the metadata specified in the configuration.
HIO_API HioGlslfxConfig::Parameters HioGlslfx::GetParameters | ( | ) | const |
Return the parameters specified in the configuration.
HIO_API std::string HioGlslfx::GetSource | ( | const TfToken & | shaderStageKey | ) | const |
Get the shader source associated with given key.
HIO_API std::string HioGlslfx::GetSurfaceSource | ( | ) | const |
Get the surface source string.
HIO_API HioGlslfxConfig::Textures HioGlslfx::GetTextures | ( | ) | const |
Return the textures specified in the configuration.
HIO_API std::string HioGlslfx::GetVolumeSource | ( | ) | const |
Get the volume source string.
HIO_API bool HioGlslfx::IsValid | ( | std::string * | reason = NULL | ) | const |
Returns true if this is a valid glslfx file.