2010-07-15 12:49:09 -07:00
|
|
|
diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
|
|
|
|
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
|
|
|
|
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -1,16 +1,36 @@
|
2010-10-09 12:44:25 -07:00
|
|
|
//
|
|
|
|
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
//
|
2010-07-15 14:38:22 -07:00
|
|
|
#ifndef _COMPILER_INTERFACE_INCLUDED_
|
|
|
|
#define _COMPILER_INTERFACE_INCLUDED_
|
|
|
|
|
2010-12-03 14:44:01 -08:00
|
|
|
+#ifdef MOZILLA_VERSION
|
2010-07-15 14:38:22 -07:00
|
|
|
+#include "nscore.h"
|
|
|
|
+
|
2010-07-30 15:22:11 -07:00
|
|
|
+#ifdef WIN32
|
2010-07-17 05:22:26 -07:00
|
|
|
+# if !defined(MOZ_ENABLE_LIBXUL) && !defined(MOZ_STATIC_BUILD)
|
2010-07-15 14:38:22 -07:00
|
|
|
+# ifdef ANGLE_BUILD
|
|
|
|
+# define ANGLE_API NS_EXPORT
|
|
|
|
+# else
|
|
|
|
+# define ANGLE_API NS_IMPORT
|
|
|
|
+# endif
|
|
|
|
+# else
|
|
|
|
+# define ANGLE_API /*nothing*/
|
|
|
|
+# endif
|
2010-07-30 15:22:11 -07:00
|
|
|
+#else
|
2010-07-15 14:38:22 -07:00
|
|
|
+# define ANGLE_API NS_EXTERNAL_VIS
|
2010-07-30 15:22:11 -07:00
|
|
|
+#endif
|
2010-12-03 14:44:01 -08:00
|
|
|
+#else
|
|
|
|
+#define ANGLE_API /*nothing*/
|
|
|
|
+#endif
|
2010-07-30 15:22:11 -07:00
|
|
|
+
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
2010-07-15 14:38:22 -07:00
|
|
|
// This is the platform independent interface between an OGL driver
|
2010-07-30 15:22:11 -07:00
|
|
|
// and the shading language compiler.
|
2010-10-09 12:44:25 -07:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -73,21 +93,21 @@ typedef enum {
|
|
|
|
SH_OBJECT_CODE = 0x0004,
|
|
|
|
SH_ATTRIBUTES_UNIFORMS = 0x0008
|
2010-10-09 12:44:25 -07:00
|
|
|
} ShCompileOptions;
|
|
|
|
|
|
|
|
//
|
2010-07-15 12:49:09 -07:00
|
|
|
// Driver must call this first, once, before doing any other
|
2010-07-30 15:22:11 -07:00
|
|
|
// compiler operations.
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
|
|
|
-int ShInitialize();
|
2010-07-15 14:38:22 -07:00
|
|
|
+ANGLE_API int ShInitialize();
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
|
|
|
// Driver should call this at shutdown.
|
|
|
|
//
|
2010-07-30 15:22:11 -07:00
|
|
|
-int ShFinalize();
|
2010-07-15 14:38:22 -07:00
|
|
|
+ANGLE_API int ShFinalize();
|
2010-10-09 12:44:25 -07:00
|
|
|
|
|
|
|
//
|
|
|
|
// Implementation dependent built-in resources (constants and extensions).
|
|
|
|
// The names for these resources has been obtained by stripping gl_/GL_.
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
2010-10-09 12:44:25 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
// Constants.
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -103,17 +123,17 @@ typedef struct
|
2010-10-09 12:44:25 -07:00
|
|
|
// Extensions.
|
|
|
|
// Set to 1 to enable the extension, else 0.
|
|
|
|
int OES_standard_derivatives;
|
|
|
|
} ShBuiltInResources;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Initialize built-in resources with minimum expected values.
|
|
|
|
//
|
|
|
|
-void ShInitBuiltInResources(ShBuiltInResources* resources);
|
|
|
|
+ANGLE_API void ShInitBuiltInResources(ShBuiltInResources* resources);
|
|
|
|
|
|
|
|
//
|
|
|
|
// ShHandle held by but opaque to the driver. It is allocated,
|
|
|
|
// managed, and de-allocated by the compiler. It's contents
|
|
|
|
// are defined by and used by the compiler.
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
2010-10-09 12:44:25 -07:00
|
|
|
// If handle creation fails, 0 will be returned.
|
2010-07-15 14:38:22 -07:00
|
|
|
//
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -123,19 +143,19 @@ typedef void* ShHandle;
|
2010-07-30 15:22:11 -07:00
|
|
|
// Driver calls these to create and destroy compiler objects.
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
2010-10-09 12:44:25 -07:00
|
|
|
// Returns the handle of constructed compiler.
|
|
|
|
// 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.
|
|
|
|
// resources: Specifies the built-in resources.
|
|
|
|
-ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
|
|
|
|
+ANGLE_API ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
|
|
|
|
const ShBuiltInResources* resources);
|
|
|
|
-void ShDestruct(ShHandle handle);
|
|
|
|
+ANGLE_API void ShDestruct(ShHandle handle);
|
2010-07-15 12:49:09 -07:00
|
|
|
|
|
|
|
//
|
2010-10-09 12:44:25 -07:00
|
|
|
// Compiles the given shader source.
|
|
|
|
// If the function succeeds, the return value is nonzero, else zero.
|
|
|
|
// Parameters:
|
|
|
|
// handle: Specifies the handle of compiler to be used.
|
|
|
|
// shaderStrings: Specifies an array of pointers to null-terminated strings
|
|
|
|
// containing the shader source code.
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -152,17 +172,17 @@ void ShDestruct(ShHandle handle);
|
2010-10-09 12:44:25 -07:00
|
|
|
// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
|
|
|
|
// 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().
|
2010-07-15 12:49:09 -07:00
|
|
|
//
|
|
|
|
-int ShCompile(
|
2010-07-15 14:38:22 -07:00
|
|
|
+ANGLE_API int ShCompile(
|
2010-10-09 12:44:25 -07:00
|
|
|
const ShHandle handle,
|
2010-07-30 15:22:11 -07:00
|
|
|
const char* const shaderStrings[],
|
|
|
|
const int numStrings,
|
2010-10-09 12:44:25 -07:00
|
|
|
int compileOptions
|
|
|
|
);
|
|
|
|
|
|
|
|
// Returns a parameter from a compiled shader.
|
|
|
|
// Parameters:
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -178,53 +198,53 @@ int ShCompile(
|
2010-10-09 12:44:25 -07:00
|
|
|
// variable name including the null
|
|
|
|
// termination character.
|
|
|
|
// SH_ACTIVE_UNIFORMS: the number of active uniform variables.
|
|
|
|
// SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
|
|
|
|
// variable name including the null
|
|
|
|
// termination character.
|
|
|
|
//
|
|
|
|
// params: Requested parameter
|
|
|
|
-void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
|
|
|
|
+ANGLE_API void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
|
|
|
|
|
|
|
|
// Returns nul-terminated information log for a compiled shader.
|
|
|
|
// Parameters:
|
|
|
|
// handle: Specifies the compiler
|
|
|
|
// infoLog: Specifies an array of characters that is used to return
|
|
|
|
// the information log. It is assumed that infoLog has enough memory
|
|
|
|
// 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);
|
|
|
|
+ANGLE_API void ShGetInfoLog(const ShHandle handle, char* infoLog);
|
|
|
|
|
|
|
|
// Returns null-terminated object code for a compiled shader.
|
|
|
|
// Parameters:
|
|
|
|
// handle: Specifies the compiler
|
|
|
|
// infoLog: Specifies an array of characters that is used to return
|
|
|
|
// the object code. It is assumed that infoLog has enough memory to
|
|
|
|
// 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);
|
|
|
|
+ANGLE_API void ShGetObjectCode(const ShHandle handle, char* objCode);
|
|
|
|
|
|
|
|
// Returns information about an active attribute variable.
|
|
|
|
// Parameters:
|
|
|
|
// handle: Specifies the compiler
|
|
|
|
// index: Specifies the index of the attribute 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.
|
|
|
|
// 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.
|
|
|
|
-void ShGetActiveAttrib(const ShHandle handle,
|
|
|
|
+ANGLE_API void ShGetActiveAttrib(const ShHandle handle,
|
|
|
|
int index,
|
|
|
|
int* length,
|
|
|
|
int* size,
|
|
|
|
ShDataType* type,
|
|
|
|
char* name);
|
|
|
|
|
|
|
|
// Returns information about an active uniform variable.
|
|
|
|
// Parameters:
|
2010-12-03 14:44:01 -08:00
|
|
|
@@ -235,17 +255,17 @@ void ShGetActiveAttrib(const ShHandle ha
|
2010-10-09 12:44:25 -07:00
|
|
|
// 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.
|
|
|
|
-void ShGetActiveUniform(const ShHandle handle,
|
|
|
|
+ANGLE_API void ShGetActiveUniform(const ShHandle handle,
|
|
|
|
int index,
|
|
|
|
int* length,
|
|
|
|
int* size,
|
|
|
|
ShDataType* type,
|
|
|
|
char* name);
|
2010-07-15 12:49:09 -07:00
|
|
|
|
2010-07-30 15:22:11 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|