24 #ifndef PXR_IMAGING_HIO_GLSLFX_H
25 #define PXR_IMAGING_HIO_GLSLFX_H
46 #define HIO_GLSLFX_API_VERSION 1
48 #define HIO_GLSLFX_TOKENS \
53 (geometryShaderInjection) \
57 (postTessControlShader) \
58 (postTessVertexShader) \
60 (vertexShaderInjection) \
63 (displacementShader) \
161 TfToken const & technique = HioGlslfxTokens->defVal);
167 TfToken const & technique = HioGlslfxTokens->defVal);
224 const std::set<std::string>&
GetFiles()
const {
return _seenFiles; }
237 class _ParseContext {
250 std::vector<std::string> imports;
255 _ParseContext & context);
256 bool _ProcessInput(std::istream * input,
257 _ParseContext & context);
258 bool _ProcessImport(_ParseContext & context);
259 bool _ParseSectionLine(_ParseContext & context);
260 bool _ParseGLSLSectionLine(std::vector<std::string>
const &tokens,
261 _ParseContext & context);
262 bool _ParseLayoutSectionLine(std::vector<std::string>
const &tokens,
263 _ParseContext & context);
264 bool _ParseVersionLine(std::vector<std::string>
const &tokens,
265 _ParseContext & context);
266 bool _ParseConfigurationLine(_ParseContext & context);
277 _ParseContext _globalContext;
279 typedef std::map<std::string, std::string> _SourceMap;
281 _SourceMap _sourceMap;
282 _SourceMap _layoutMap;
283 _SourceMap _configMap;
284 std::vector<std::string> _configOrder;
285 std::set<std::string> _seenFiles;
287 std::unique_ptr<HioGlslfxConfig> _config;
GT_API const UT_StringHolder filename
std::vector< Attribute > Attributes
HIO_API HioGlslfxConfig::Parameters GetParameters() const
Return the parameters specified in the configuration.
static HIO_API std::vector< std::string > ExtractImports(const std::string &filename)
GLsizei const GLchar *const * string
HIO_API HioGlslfxConfig::Attributes GetAttributes() const
Return the attributes specified in the configuration.
HIO_API bool IsValid(std::string *reason=NULL) const
Returns true if this is a valid glslfx file.
HIO_API std::string GetSurfaceSource() const
Get the surface source string.
const std::set< std::string > & GetFiles() const
std::vector< Parameter > Parameters
size_t GetHash() const
Return the computed hash value based on the string.
std::vector< TfToken > TfTokenVector
Convenience types.
#define HIO_GLSLFX_TOKENS
GT_API const UT_StringHolder version
const std::string & GetFilePath() const
Get the original file name passed to the constructor.
HIO_API VtDictionary GetLayoutAsDictionary(const TfTokenVector &shaderStageKeys, std::string *errorStr) const
HIO_API HioGlslfxConfig::MetadataDictionary GetMetadata() const
Return the metadata specified in the configuration.
HIO_API HioGlslfxConfig::Textures GetTextures() const
Return the textures specified in the configuration.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
HIO_API std::string GetVolumeSource() const
Get the volume source string.
TF_DECLARE_PUBLIC_TOKENS(HioGlslfxTokens, HIO_API, HIO_GLSLFX_TOKENS)
std::vector< Texture > Textures
HIO_API HioGlslfx()
Create an invalid glslfx object.
HIO_API std::string GetSource(const TfToken &shaderStageKey) const
Get the shader source associated with given key.
HIO_API std::string GetDisplacementSource() const
Get the displacement source string.