summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/include/GLSLANG/ShaderLang.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/include/GLSLANG/ShaderLang.h')
-rw-r--r--src/3rdparty/angle/include/GLSLANG/ShaderLang.h130
1 files changed, 84 insertions, 46 deletions
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
@@ -109,12 +109,21 @@ typedef enum {
} 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
SH_ACTIVE_UNIFORMS = 0x8B86,
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