From e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 24 Mar 2016 12:38:18 +0100 Subject: Update ANGLE to chromium/2651 Change-Id: I1cd32b780b1a0b913fab870e155ae1f4f9ac40d7 Reviewed-by: Maurice Kalinowski --- src/3rdparty/angle/include/GLSLANG/ShaderLang.h | 80 +++++++++++++++++++------ src/3rdparty/angle/include/GLSLANG/ShaderVars.h | 46 +++++++++++--- 2 files changed, 100 insertions(+), 26 deletions(-) (limited to 'src/3rdparty/angle/include/GLSLANG') diff --git a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h index 126205af2c..d02723e760 100644 --- a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h +++ b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h @@ -48,7 +48,7 @@ typedef unsigned int GLenum; // Version number for shader translation API. // It is incremented every time the API changes. -#define ANGLE_SH_VERSION 134 +#define ANGLE_SH_VERSION 143 typedef enum { SH_GLES2_SPEC = 0x8B40, @@ -80,17 +80,35 @@ typedef enum { SH_CSS_SHADERS_SPEC = 0x8B42 } ShShaderSpec; -typedef enum { - SH_ESSL_OUTPUT = 0x8B45, - // SH_GLSL_OUTPUT is deprecated. This is to not break the build. - SH_GLSL_OUTPUT = 0x8B46, - SH_GLSL_COMPATIBILITY_OUTPUT = 0x8B46, - SH_GLSL_CORE_OUTPUT = 0x8B47, - - // HLSL output only supported in some configurations. - SH_HLSL_OUTPUT = 0x8B48, - SH_HLSL9_OUTPUT = 0x8B48, - SH_HLSL11_OUTPUT = 0x8B49 +typedef enum +{ + // ESSL output only supported in some configurations. + SH_ESSL_OUTPUT = 0x8B45, + + // GLSL output only supported in some configurations. + SH_GLSL_COMPATIBILITY_OUTPUT = 0x8B46, + // Note: GL introduced core profiles in 1.5. + SH_GLSL_130_OUTPUT = 0x8B47, + SH_GLSL_140_OUTPUT = 0x8B80, + SH_GLSL_150_CORE_OUTPUT = 0x8B81, + SH_GLSL_330_CORE_OUTPUT = 0x8B82, + SH_GLSL_400_CORE_OUTPUT = 0x8B83, + SH_GLSL_410_CORE_OUTPUT = 0x8B84, + SH_GLSL_420_CORE_OUTPUT = 0x8B85, + SH_GLSL_430_CORE_OUTPUT = 0x8B86, + SH_GLSL_440_CORE_OUTPUT = 0x8B87, + SH_GLSL_450_CORE_OUTPUT = 0x8B88, + + // HLSL output only supported in some configurations. + // Deprecated: + SH_HLSL_OUTPUT = 0x8B48, + SH_HLSL9_OUTPUT = 0x8B48, + SH_HLSL11_OUTPUT = 0x8B49, + + // Prefer using these to specify HLSL output type: + SH_HLSL_3_0_OUTPUT = 0x8B48, // D3D 9 + SH_HLSL_4_1_OUTPUT = 0x8B49, // D3D 11 + SH_HLSL_4_0_FL9_3_OUTPUT = 0x8B4A // D3D 11 feature level 9_3 } ShShaderOutput; // Compile options. @@ -112,7 +130,7 @@ typedef enum { // This is needed only as a workaround for certain OpenGL driver bugs. SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100, - // This is an experimental flag to enforce restrictions that aim to prevent + // This is an experimental flag to enforce restrictions that aim to prevent // timing attacks. // It generates compilation errors for shaders that could expose sensitive // texture information via the timing channel. @@ -177,6 +195,19 @@ typedef enum { // It is intended as a workaround for drivers that do not handle // struct scopes correctly, including all Mac drivers and Linux AMD. SH_REGENERATE_STRUCT_NAMES = 0x80000, + + // This flag makes the compiler not prune unused function early in the + // compilation process. Pruning coupled with SH_LIMIT_CALL_STACK_DEPTH + // helps avoid bad shaders causing stack overflows. + SH_DONT_PRUNE_UNUSED_FUNCTIONS = 0x100000, + + // This flag works around a bug in NVIDIA 331 series drivers related + // to pow(x, y) where y is a constant vector. + SH_REMOVE_POW_WITH_CONSTANT_EXPONENT = 0x200000, + + // This flag works around bugs in Mac drivers related to do-while by + // transforming them into an other construct. + SH_REWRITE_DO_WHILE_LOOPS = 0x400000, } ShCompileOptions; // Defines alternate strategies for implementing array index clamping. @@ -225,6 +256,7 @@ typedef struct int OES_standard_derivatives; int OES_EGL_image_external; int ARB_texture_rectangle; + int EXT_blend_func_extended; int EXT_draw_buffers; int EXT_frag_depth; int EXT_shader_texture_lod; @@ -239,7 +271,9 @@ typedef struct // function. This applies to Tegra K1 devices. int NV_draw_buffers; - // Set to 1 if highp precision is supported in the fragment language. + // Set to 1 if highp precision is supported in the ESSL 1.00 version of the + // fragment language. Does not affect versions of the language where highp + // support is mandatory. // Default is 0. int FragmentPrecisionHigh; @@ -249,6 +283,13 @@ typedef struct int MinProgramTexelOffset; int MaxProgramTexelOffset; + // Extension constants. + + // Value of GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT for OpenGL ES output context. + // Value of GL_MAX_DUAL_SOURCE_DRAW_BUFFERS for OpenGL output context. + // GLES SL version 100 gl_MaxDualSourceDrawBuffersEXT value for EXT_blend_func_extended. + int MaxDualSourceDrawBuffers; + // Name Hashing. // Set a 64 bit hash function to enable user-defined name hashing. // Default is NULL. @@ -298,9 +339,9 @@ COMPILER_EXPORT const std::string &ShGetBuiltInResourcesString(const ShHandle ha // type: Specifies the type of shader - GL_FRAGMENT_SHADER or GL_VERTEX_SHADER. // spec: Specifies the language spec the compiler must conform to - // SH_GLES2_SPEC or SH_WEBGL_SPEC. -// output: Specifies the output code type - SH_ESSL_OUTPUT, SH_GLSL_OUTPUT, -// SH_HLSL9_OUTPUT or SH_HLSL11_OUTPUT. Note: HLSL output is only -// supported in some configurations. +// output: Specifies the output code type - for example SH_ESSL_OUTPUT, SH_GLSL_OUTPUT, +// SH_HLSL_3_0_OUTPUT or SH_HLSL_4_1_OUTPUT. Note: Each output type may only +// be supported in some configurations. // resources: Specifies the built-in resources. COMPILER_EXPORT ShHandle ShConstructCompiler( sh::GLenum type, @@ -339,6 +380,9 @@ COMPILER_EXPORT bool ShCompile( size_t numStrings, int compileOptions); +// Clears the results from the previous compilation. +COMPILER_EXPORT void ShClearResults(const ShHandle handle); + // Return the version of the shader language. COMPILER_EXPORT int ShGetShaderVersion(const ShHandle handle); @@ -373,7 +417,7 @@ COMPILER_EXPORT const std::map *ShGetNameHashingMap( COMPILER_EXPORT const std::vector *ShGetUniforms(const ShHandle handle); COMPILER_EXPORT const std::vector *ShGetVaryings(const ShHandle handle); COMPILER_EXPORT const std::vector *ShGetAttributes(const ShHandle handle); -COMPILER_EXPORT const std::vector *ShGetOutputVariables(const ShHandle handle); +COMPILER_EXPORT const std::vector *ShGetOutputVariables(const ShHandle handle); COMPILER_EXPORT const std::vector *ShGetInterfaceBlocks(const ShHandle handle); typedef struct 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 fields; }; -} +} // namespace sh #endif // GLSLANG_SHADERVARS_H_ -- cgit v1.2.3