diff options
Diffstat (limited to 'src/3rdparty/angle/include/GLSLANG/ShaderVars.h')
-rw-r--r-- | src/3rdparty/angle/include/GLSLANG/ShaderVars.h | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/src/3rdparty/angle/include/GLSLANG/ShaderVars.h b/src/3rdparty/angle/include/GLSLANG/ShaderVars.h index 4128c343f8..af9b65b7f5 100644 --- a/src/3rdparty/angle/include/GLSLANG/ShaderVars.h +++ b/src/3rdparty/angle/include/GLSLANG/ShaderVars.h @@ -70,6 +70,8 @@ struct COMPILER_EXPORT ShaderVariable const ShaderVariable **leafVar, std::string* originalFullName) const; + bool isBuiltIn() const { return name.compare(0, 3, "gl_") == 0; } + GLenum type; GLenum precision; std::string name; @@ -108,19 +110,39 @@ struct COMPILER_EXPORT Uniform : public ShaderVariable bool isSameUniformAtLinkTime(const Uniform &other) const; }; -struct COMPILER_EXPORT Attribute : public ShaderVariable +// An interface variable is a variable which passes data between the GL data structures and the +// shader execution: either vertex shader inputs or fragment shader outputs. These variables can +// have integer locations to pass back to the GL API. +struct COMPILER_EXPORT InterfaceVariable : public ShaderVariable +{ + InterfaceVariable(); + ~InterfaceVariable(); + InterfaceVariable(const InterfaceVariable &other); + InterfaceVariable &operator=(const InterfaceVariable &other); + bool operator==(const InterfaceVariable &other) const; + bool operator!=(const InterfaceVariable &other) const { return !operator==(other); } + + int location; +}; + +struct COMPILER_EXPORT Attribute : public InterfaceVariable { Attribute(); ~Attribute(); Attribute(const Attribute &other); Attribute &operator=(const Attribute &other); bool operator==(const Attribute &other) const; - bool operator!=(const Attribute &other) const - { - return !operator==(other); - } + bool operator!=(const Attribute &other) const { return !operator==(other); } +}; - int location; +struct COMPILER_EXPORT OutputVariable : public InterfaceVariable +{ + OutputVariable(); + ~OutputVariable(); + OutputVariable(const OutputVariable &other); + OutputVariable &operator=(const OutputVariable &other); + bool operator==(const OutputVariable &other) const; + bool operator!=(const OutputVariable &other) const { return !operator==(other); } }; struct COMPILER_EXPORT InterfaceBlockField : public ShaderVariable @@ -159,7 +181,12 @@ struct COMPILER_EXPORT Varying : public ShaderVariable // Decide whether two varyings are the same at shader link time, // assuming one from vertex shader and the other from fragment shader. - // See GLSL ES Spec 3.00.3, sec 4.3.9. + // Invariance needs to match only in ESSL1. Relevant spec sections: + // GLSL ES 3.00.4, sections 4.6.1 and 4.3.9. + // GLSL ES 1.00.17, section 4.6.4. + bool isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const; + + // Deprecated version of isSameVaryingAtLinkTime, which assumes ESSL1. bool isSameVaryingAtLinkTime(const Varying &other) const; InterpolationType interpolation; @@ -173,6 +200,9 @@ struct COMPILER_EXPORT InterfaceBlock InterfaceBlock(const InterfaceBlock &other); InterfaceBlock &operator=(const InterfaceBlock &other); + // Fields from blocks with non-empty instance names are prefixed with the block name. + std::string fieldPrefix() const; + std::string name; std::string mappedName; std::string instanceName; @@ -183,6 +213,6 @@ struct COMPILER_EXPORT InterfaceBlock std::vector<InterfaceBlockField> fields; }; -} +} // namespace sh #endif // GLSLANG_SHADERVARS_H_ |