25 #ifndef PXR_IMAGING_HGI_SHADERSECTION_H 26 #define PXR_IMAGING_HGI_SHADERSECTION_H 29 #include "pxr/imaging/hgi/api.h" 35 PXR_NAMESPACE_OPEN_SCOPE
38 struct HgiShaderSectionAttribute
40 std::string identifier;
44 using HgiShaderSectionAttributeVector =
45 std::vector<HgiShaderSectionAttribute>;
65 virtual void WriteType(std::ostream& ss)
const;
98 return !_blockInstanceIdentifier.empty();
104 const std::string &identifier,
105 const HgiShaderSectionAttributeVector& attributes = {},
106 const std::string &defaultValue = std::string(),
107 const std::string &arraySize = std::string(),
108 const std::string &blockInstanceIdentifier = std::string());
111 const std::string& _GetDefaultValue()
const;
114 const std::string _identifierVar;
115 const HgiShaderSectionAttributeVector _attributes;
116 const std::string _defaultValue;
117 const std::string _arraySize;
118 const std::string _blockInstanceIdentifier;
121 PXR_NAMESPACE_CLOSE_SCOPE
const std::string & GetArraySize() const
Returns the arraySize of the section.
virtual HGI_API void WriteBlockInstanceIdentifier(std::ostream &ss) const
Writes the block instance name of an instance of the section.
virtual HGI_API void WriteDeclaration(std::ostream &ss) const
Writes a decleration statement for a member or in global scope.
HGI_API const HgiShaderSectionAttributeVector & GetAttributes() const
Returns the attributes of the section.
virtual HGI_API void WriteParameter(std::ostream &ss) const
Writes the section as a parameter to a function.
virtual HGI_API void WriteArraySize(std::ostream &ss) const
Writes the arraySize to a function.
bool HasBlockInstanceIdentifier() const
Returns whether the section has a block instance identifier.
A base class for a Shader Section.
virtual HGI_API void WriteIdentifier(std::ostream &ss) const
Writes the unique name of an instance of the section.
virtual HGI_API void WriteType(std::ostream &ss) const
Write out the type, shader section does not hold a type string as how a type is defined is fully cont...