From 1a334f8135d4be7b73b39ac736af0e722c864e83 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Wed, 18 Sep 2013 11:51:20 +0300 Subject: ANGLE: Update to version 2446 Update ANGLE and reapply patches. Patch changes: "Dynamically resolve functions of dwmapi.dll" Removed; ANGLE no longer uses DWM API "Make it possible to link ANGLE statically for single-thread use" Avoid name collision by using ANGLE-style getCurrent() "Fix build when SSE2 is not available." Added guard for __cpuid(), which is not available on ARM "Make DX9/DX11 mutually exclusive" Adjustments due to underlying code changes "ANGLE: Avoid memory copies on buffers when data is null" Removed; fixed upstream "Add missing intrin.h include for __cpuid" Removed; fixed upstream Change-Id: I4f3d850fc555d3194ddc05e0b51c4966d33f7eaf Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann Reviewed-by: Kai Koehne --- src/3rdparty/angle/include/EGL/eglext.h | 6 ++ src/3rdparty/angle/include/GLSLANG/ShaderLang.h | 130 +++++++++++++++--------- src/3rdparty/angle/include/KHR/khrplatform.h | 1 - 3 files changed, 90 insertions(+), 47 deletions(-) (limited to 'src/3rdparty/angle/include') diff --git a/src/3rdparty/angle/include/EGL/eglext.h b/src/3rdparty/angle/include/EGL/eglext.h index b670840d12..c06d4c0850 100644 --- a/src/3rdparty/angle/include/EGL/eglext.h +++ b/src/3rdparty/angle/include/EGL/eglext.h @@ -306,6 +306,12 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay #define EGL_SOFTWARE_DISPLAY_ANGLE ((EGLNativeDisplayType)-1) #endif +#ifndef EGL_ANGLE_direct3d_display +#define EGL_ANGLE_direct3d_display 1 +#define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ((EGLNativeDisplayType)-2) +#define EGL_D3D11_ONLY_DISPLAY_ANGLE ((EGLNativeDisplayType)-3) +#endif + #ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle #define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 #define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 diff --git a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h index da0f87aed9..28bf516f7f 100644 --- a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h +++ b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h @@ -37,7 +37,7 @@ extern "C" { // Version number for shader translation API. // It is incremented everytime the API changes. -#define ANGLE_SH_VERSION 110 +#define ANGLE_SH_VERSION 112 // // The names of the following enums have been derived by replacing GL prefix @@ -108,6 +108,13 @@ typedef enum { SH_SAMPLER_EXTERNAL_OES = 0x8D66 } ShDataType; +typedef enum { + SH_PRECISION_HIGHP = 0x5001, + SH_PRECISION_MEDIUMP = 0x5002, + SH_PRECISION_LOWP = 0x5003, + SH_PRECISION_UNDEFINED = 0 +} ShPrecisionType; + typedef enum { SH_INFO_LOG_LENGTH = 0x8B84, SH_OBJECT_CODE_LENGTH = 0x8B88, // GL_SHADER_SOURCE_LENGTH @@ -115,6 +122,8 @@ typedef enum { SH_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, SH_ACTIVE_ATTRIBUTES = 0x8B89, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, + SH_VARYINGS = 0x8BBB, + SH_VARYING_MAX_LENGTH = 0x8BBC, SH_MAPPED_NAME_MAX_LENGTH = 0x6000, SH_NAME_MAX_LENGTH = 0x6001, SH_HASHED_NAME_MAX_LENGTH = 0x6002, @@ -128,7 +137,7 @@ typedef enum { SH_VALIDATE_LOOP_INDEXING = 0x0001, SH_INTERMEDIATE_TREE = 0x0002, SH_OBJECT_CODE = 0x0004, - SH_ATTRIBUTES_UNIFORMS = 0x0008, + SH_VARIABLES = 0x0008, SH_LINE_DIRECTIVES = 0x0010, SH_SOURCE_PATH = 0x0020, SH_MAP_LONG_VARIABLE_NAMES = 0x0040, @@ -154,6 +163,11 @@ typedef enum { SH_DEPENDENCY_GRAPH = 0x0400, // Enforce the GLSL 1.017 Appendix A section 7 packing restrictions. + // This flag only enforces (and can only enforce) the packing + // restrictions for uniform variables in both vertex and fragment + // shaders. ShCheckVariablesWithinPackingLimits() lets embedders + // enforce the packing restrictions for varying variables during + // program link time. SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800, // This flag ensures all indirect (expression-based) array indexing @@ -162,7 +176,19 @@ typedef enum { // vec234, or mat234 type. The ShArrayIndexClampingStrategy enum, // specified in the ShBuiltInResources when constructing the // compiler, selects the strategy for the clamping implementation. - SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000 + SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000, + + // This flag limits the complexity of an expression. + SH_LIMIT_EXPRESSION_COMPLEXITY = 0x2000, + + // This flag limits the depth of the call stack. + SH_LIMIT_CALL_STACK_DEPTH = 0x4000, + + // This flag initializes gl_Position to vec4(0.0, 0.0, 0.0, 1.0) at + // the beginning of the vertex shader, and has no effect in the + // fragment shader. It is intended as a workaround for drivers which + // incorrectly fail to link programs if gl_Position is not written. + SH_INIT_GL_POSITION = 0x8000, } ShCompileOptions; // Defines alternate strategies for implementing array index clamping. @@ -212,6 +238,7 @@ typedef struct int OES_EGL_image_external; int ARB_texture_rectangle; int EXT_draw_buffers; + int EXT_frag_depth; // Set to 1 if highp precision is supported in the fragment language. // Default is 0. @@ -225,6 +252,12 @@ typedef struct // Selects a strategy to use when implementing array index clamping. // Default is SH_CLAMP_WITH_CLAMP_INTRINSIC. ShArrayIndexClampingStrategy ArrayIndexClampingStrategy; + + // The maximum complexity an expression can be. + int MaxExpressionComplexity; + + // The maximum depth a call stack can be. + int MaxCallStackDepth; } ShBuiltInResources; // @@ -281,9 +314,8 @@ COMPILER_EXPORT void ShDestruct(ShHandle handle); // Can be queried by calling ShGetInfoLog(). // SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader. // Can be queried by calling ShGetObjectCode(). -// SH_ATTRIBUTES_UNIFORMS: Extracts attributes and uniforms. -// Can be queried by calling ShGetActiveAttrib() and -// ShGetActiveUniform(). +// SH_VARIABLES: Extracts attributes, uniforms, and varyings. +// Can be queried by calling ShGetVariableInfo(). // COMPILER_EXPORT int ShCompile( const ShHandle handle, @@ -309,6 +341,9 @@ COMPILER_EXPORT int ShCompile( // SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform // variable name including the null // termination character. +// SH_VARYINGS: the number of varying variables. +// SH_VARYING_MAX_LENGTH: the length of the longest varying variable name +// including the null termination character. // SH_MAPPED_NAME_MAX_LENGTH: the length of the mapped variable name including // the null termination character. // SH_NAME_MAX_LENGTH: the max length of a user-defined name including the @@ -342,60 +377,44 @@ COMPILER_EXPORT void ShGetInfoLog(const ShHandle handle, char* infoLog); // ShGetInfo with SH_OBJECT_CODE_LENGTH. COMPILER_EXPORT void ShGetObjectCode(const ShHandle handle, char* objCode); -// Returns information about an active attribute variable. +// Returns information about a shader variable. // Parameters: // handle: Specifies the compiler -// index: Specifies the index of the attribute variable to be queried. +// variableType: Specifies the variable type; options include +// SH_ACTIVE_ATTRIBUTES, SH_ACTIVE_UNIFORMS, SH_VARYINGS. +// index: Specifies the index of the variable to be queried. // length: Returns the number of characters actually written in the string // indicated by name (excluding the null terminator) if a value other // than NULL is passed. -// size: Returns the size of the attribute variable. -// type: Returns the data type of the attribute variable. +// size: Returns the size of the variable. +// type: Returns the data type of the variable. +// precision: Returns the precision of the variable. +// staticUse: Returns 1 if the variable is accessed in a statement after +// pre-processing, whether or not run-time flow of control will +// cause that statement to be executed. +// Returns 0 otherwise. // name: Returns a null terminated string containing the name of the -// attribute variable. It is assumed that name has enough memory to -// accomodate the attribute variable name. The size of the buffer -// required to store the attribute variable name can be obtained by -// calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH. +// variable. It is assumed that name has enough memory to accormodate +// the variable name. The size of the buffer required to store the +// variable name can be obtained by calling ShGetInfo with +// SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, SH_ACTIVE_UNIFORM_MAX_LENGTH, +// SH_VARYING_MAX_LENGTH. // mappedName: Returns a null terminated string containing the mapped name of -// the attribute variable, It is assumed that mappedName has enough -// memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care -// about the mapped name. If the name is not mapped, then name and -// mappedName are the same. -COMPILER_EXPORT void ShGetActiveAttrib(const ShHandle handle, +// the variable, It is assumed that mappedName has enough memory +// (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care about the +// mapped name. If the name is not mapped, then name and mappedName +// are the same. +COMPILER_EXPORT void ShGetVariableInfo(const ShHandle handle, + ShShaderInfo variableType, int index, size_t* length, int* size, ShDataType* type, + ShPrecisionType* precision, + int* staticUse, char* name, char* mappedName); -// Returns information about an active uniform variable. -// Parameters: -// handle: Specifies the compiler -// index: Specifies the index of the uniform variable to be queried. -// length: Returns the number of characters actually written in the string -// indicated by name (excluding the null terminator) if a value -// other than NULL is passed. -// size: Returns the size of the uniform variable. -// type: Returns the data type of the uniform variable. -// name: Returns a null terminated string containing the name of the -// uniform variable. It is assumed that name has enough memory to -// accomodate the uniform variable name. The size of the buffer required -// to store the uniform variable name can be obtained by calling -// ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH. -// mappedName: Returns a null terminated string containing the mapped name of -// the uniform variable, It is assumed that mappedName has enough -// memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care -// about the mapped name. If the name is not mapped, then name and -// mappedName are the same. -COMPILER_EXPORT void ShGetActiveUniform(const ShHandle handle, - int index, - size_t* length, - int* size, - ShDataType* type, - char* name, - char* mappedName); - // Returns information about a name hashing entry from the latest compile. // Parameters: // handle: Specifies the compiler @@ -426,6 +445,25 @@ COMPILER_EXPORT void ShGetInfoPointer(const ShHandle handle, ShShaderInfo pname, void** params); +typedef struct +{ + ShDataType type; + int size; +} ShVariableInfo; + +// Returns 1 if the passed in variables pack in maxVectors following +// the packing rules from the GLSL 1.017 spec, Appendix A, section 7. +// Returns 0 otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS +// flag above. +// Parameters: +// maxVectors: the available rows of registers. +// varInfoArray: an array of variable info (types and sizes). +// varInfoArraySize: the size of the variable array. +COMPILER_EXPORT int ShCheckVariablesWithinPackingLimits( + int maxVectors, + ShVariableInfo* varInfoArray, + size_t varInfoArraySize); + #ifdef __cplusplus } #endif diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h index 18a104ea1f..001e925f46 100644 --- a/src/3rdparty/angle/include/KHR/khrplatform.h +++ b/src/3rdparty/angle/include/KHR/khrplatform.h @@ -97,7 +97,6 @@ *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ - #if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(QT_OPENGL_ES_2_ANGLE_STATIC) # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) -- cgit v1.2.3