summaryrefslogtreecommitdiffstats
path: root/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h')
-rw-r--r--Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h119
1 files changed, 88 insertions, 31 deletions
diff --git a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
index d0664e4..a3fc935 100644
--- a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
+++ b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
@@ -6,6 +6,23 @@
#ifndef _COMPILER_INTERFACE_INCLUDED_
#define _COMPILER_INTERFACE_INCLUDED_
+#if defined(COMPONENT_BUILD)
+#if defined(_WIN32) || defined(_WIN64)
+
+#if defined(COMPILER_IMPLEMENTATION)
+#define COMPILER_EXPORT __declspec(dllexport)
+#else
+#define COMPILER_EXPORT __declspec(dllimport)
+#endif // defined(COMPILER_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#define COMPILER_EXPORT __attribute__((visibility("default")))
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define COMPILER_EXPORT
+#endif
+
//
// This is the platform independent interface between an OGL driver
// and the shading language compiler.
@@ -17,7 +34,7 @@ extern "C" {
// Version number for shader translation API.
// It is incremented everytime the API changes.
-#define SH_VERSION 103
+#define SH_VERSION 105
//
// The names of the following enums have been derived by replacing GL prefix
@@ -36,6 +53,12 @@ typedef enum {
} ShShaderSpec;
typedef enum {
+ SH_ESSL_OUTPUT = 0x8B45,
+ SH_GLSL_OUTPUT = 0x8B46,
+ SH_HLSL_OUTPUT = 0x8B47
+} ShShaderOutput;
+
+typedef enum {
SH_NONE = 0,
SH_INT = 0x1404,
SH_FLOAT = 0x1406,
@@ -53,7 +76,9 @@ typedef enum {
SH_FLOAT_MAT3 = 0x8B5B,
SH_FLOAT_MAT4 = 0x8B5C,
SH_SAMPLER_2D = 0x8B5E,
- SH_SAMPLER_CUBE = 0x8B60
+ SH_SAMPLER_CUBE = 0x8B60,
+ SH_SAMPLER_2D_RECT_ARB = 0x8B63,
+ SH_SAMPLER_EXTERNAL_OES = 0x8D66
} ShDataType;
typedef enum {
@@ -62,16 +87,24 @@ typedef enum {
SH_ACTIVE_UNIFORMS = 0x8B86,
SH_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
SH_ACTIVE_ATTRIBUTES = 0x8B89,
- SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A
+ SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
+ SH_MAPPED_NAME_MAX_LENGTH = 0x8B8B
} ShShaderInfo;
// Compile options.
typedef enum {
- SH_VALIDATE = 0,
- SH_VALIDATE_LOOP_INDEXING = 0x0001,
- SH_INTERMEDIATE_TREE = 0x0002,
- SH_OBJECT_CODE = 0x0004,
- SH_ATTRIBUTES_UNIFORMS = 0x0008
+ SH_VALIDATE = 0,
+ SH_VALIDATE_LOOP_INDEXING = 0x0001,
+ SH_INTERMEDIATE_TREE = 0x0002,
+ SH_OBJECT_CODE = 0x0004,
+ SH_ATTRIBUTES_UNIFORMS = 0x0008,
+ SH_LINE_DIRECTIVES = 0x0010,
+ SH_SOURCE_PATH = 0x0020,
+ SH_MAP_LONG_VARIABLE_NAMES = 0x0040,
+ SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX = 0x0080,
+
+ // This is needed only as a workaround for certain OpenGL driver bugs.
+ SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100
} ShCompileOptions;
//
@@ -79,12 +112,12 @@ typedef enum {
// compiler operations.
// If the function succeeds, the return value is nonzero, else zero.
//
-int ShInitialize();
+COMPILER_EXPORT int ShInitialize();
//
// Driver should call this at shutdown.
// If the function succeeds, the return value is nonzero, else zero.
//
-int ShFinalize();
+COMPILER_EXPORT int ShFinalize();
//
// Implementation dependent built-in resources (constants and extensions).
@@ -105,12 +138,14 @@ typedef struct
// Extensions.
// Set to 1 to enable the extension, else 0.
int OES_standard_derivatives;
+ int OES_EGL_image_external;
+ int ARB_texture_rectangle;
} ShBuiltInResources;
//
// Initialize built-in resources with minimum expected values.
//
-void ShInitBuiltInResources(ShBuiltInResources* resources);
+COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources);
//
// ShHandle held by but opaque to the driver. It is allocated,
@@ -124,15 +159,21 @@ typedef void* ShHandle;
//
// Driver calls these to create and destroy compiler objects.
//
-// Returns the handle of constructed compiler.
+// Returns the handle of constructed compiler, null if the requested compiler is
+// not supported.
// Parameters:
// type: Specifies the type of shader - SH_FRAGMENT_SHADER or SH_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,
+// or SH_HLSL_OUTPUT.
// resources: Specifies the built-in resources.
-ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
- const ShBuiltInResources* resources);
-void ShDestruct(ShHandle handle);
+COMPILER_EXPORT ShHandle ShConstructCompiler(
+ ShShaderType type,
+ ShShaderSpec spec,
+ ShShaderOutput output,
+ const ShBuiltInResources* resources);
+COMPILER_EXPORT void ShDestruct(ShHandle handle);
//
// Compiles the given shader source.
@@ -159,7 +200,7 @@ void ShDestruct(ShHandle handle);
// Can be queried by calling ShGetActiveAttrib() and
// ShGetActiveUniform().
//
-int ShCompile(
+COMPILER_EXPORT int ShCompile(
const ShHandle handle,
const char* const shaderStrings[],
const int numStrings,
@@ -183,9 +224,13 @@ int ShCompile(
// SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
// variable name including the null
// termination character.
+// SH_MAPPED_NAME_MAX_LENGTH: the length of the mapped variable name including
+// the null termination character.
//
// params: Requested parameter
-void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
+COMPILER_EXPORT void ShGetInfo(const ShHandle handle,
+ ShShaderInfo pname,
+ int* params);
// Returns nul-terminated information log for a compiled shader.
// Parameters:
@@ -195,7 +240,7 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
// to accomodate the information log. The size of the buffer required
// to store the returned information log can be obtained by calling
// ShGetInfo with SH_INFO_LOG_LENGTH.
-void ShGetInfoLog(const ShHandle handle, char* infoLog);
+COMPILER_EXPORT void ShGetInfoLog(const ShHandle handle, char* infoLog);
// Returns null-terminated object code for a compiled shader.
// Parameters:
@@ -205,7 +250,7 @@ void ShGetInfoLog(const ShHandle handle, char* infoLog);
// accomodate the object code. The size of the buffer required to
// store the returned object code can be obtained by calling
// ShGetInfo with SH_OBJECT_CODE_LENGTH.
-void ShGetObjectCode(const ShHandle handle, char* objCode);
+COMPILER_EXPORT void ShGetObjectCode(const ShHandle handle, char* objCode);
// Returns information about an active attribute variable.
// Parameters:
@@ -221,12 +266,18 @@ void ShGetObjectCode(const ShHandle handle, char* objCode);
// 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.
-void ShGetActiveAttrib(const ShHandle handle,
- int index,
- int* length,
- int* size,
- ShDataType* type,
- char* name);
+// 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,
+ int index,
+ int* length,
+ int* size,
+ ShDataType* type,
+ char* name,
+ char* mappedName);
// Returns information about an active uniform variable.
// Parameters:
@@ -242,12 +293,18 @@ void ShGetActiveAttrib(const ShHandle handle,
// 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.
-void ShGetActiveUniform(const ShHandle handle,
- int index,
- int* length,
- int* size,
- ShDataType* type,
- char* name);
+// 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,
+ int* length,
+ int* size,
+ ShDataType* type,
+ char* name,
+ char* mappedName);
#ifdef __cplusplus
}