zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ShaderLang.h File Reference
#include "KHR/khrplatform.h"
#include <stddef.h>

Go to the source code of this file.

Classes

struct  ShBuiltInResources
 

Macros

#define ANGLE_SH_VERSION   110
 
#define COMPILER_EXPORT
 

Typedefs

typedef voidShHandle
 
typedef khronos_uint64_t(* ShHashFunction64 )(const char *, size_t)
 

Enumerations

enum  ShArrayIndexClampingStrategy { SH_CLAMP_WITH_CLAMP_INTRINSIC = 1, SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION }
 
enum  ShCompileOptions {
  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, SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100, SH_TIMING_RESTRICTIONS = 0x0200, SH_DEPENDENCY_GRAPH = 0x0400,
  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800, SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000, SH_LIMIT_EXPRESSION_COMPLEXITY = 0x2000, SH_LIMIT_CALL_STACK_DEPTH = 0x4000
}
 
enum  ShDataType {
  SH_NONE = 0, SH_INT = 0x1404, SH_FLOAT = 0x1406, SH_FLOAT_VEC2 = 0x8B50,
  SH_FLOAT_VEC3 = 0x8B51, SH_FLOAT_VEC4 = 0x8B52, SH_INT_VEC2 = 0x8B53, SH_INT_VEC3 = 0x8B54,
  SH_INT_VEC4 = 0x8B55, SH_BOOL = 0x8B56, SH_BOOL_VEC2 = 0x8B57, SH_BOOL_VEC3 = 0x8B58,
  SH_BOOL_VEC4 = 0x8B59, SH_FLOAT_MAT2 = 0x8B5A, SH_FLOAT_MAT3 = 0x8B5B, SH_FLOAT_MAT4 = 0x8B5C,
  SH_SAMPLER_2D = 0x8B5E, SH_SAMPLER_CUBE = 0x8B60, SH_SAMPLER_2D_RECT_ARB = 0x8B63, SH_SAMPLER_EXTERNAL_OES = 0x8D66
}
 
enum  ShShaderInfo {
  SH_INFO_LOG_LENGTH = 0x8B84, SH_OBJECT_CODE_LENGTH = 0x8B88, SH_ACTIVE_UNIFORMS = 0x8B86, SH_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
  SH_ACTIVE_ATTRIBUTES = 0x8B89, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, SH_MAPPED_NAME_MAX_LENGTH = 0x6000, SH_NAME_MAX_LENGTH = 0x6001,
  SH_HASHED_NAME_MAX_LENGTH = 0x6002, SH_HASHED_NAMES_COUNT = 0x6003, SH_ACTIVE_UNIFORMS_ARRAY = 0x6004
}
 
enum  ShShaderOutput {
  SH_ESSL_OUTPUT = 0x8B45, SH_GLSL_OUTPUT = 0x8B46, SH_HLSL_OUTPUT = 0x8B47, SH_HLSL9_OUTPUT = 0x8B47,
  SH_HLSL11_OUTPUT = 0x8B48
}
 
enum  ShShaderSpec { SH_GLES2_SPEC = 0x8B40, SH_WEBGL_SPEC = 0x8B41, SH_CSS_SHADERS_SPEC = 0x8B42 }
 
enum  ShShaderType { SH_FRAGMENT_SHADER = 0x8B30, SH_VERTEX_SHADER = 0x8B31 }
 

Functions

COMPILER_EXPORT int ShCompile (const ShHandle handle, const char *const shaderStrings[], size_t numStrings, int compileOptions)
 
COMPILER_EXPORT ShHandle ShConstructCompiler (ShShaderType type, ShShaderSpec spec, ShShaderOutput output, const ShBuiltInResources *resources)
 
COMPILER_EXPORT void ShDestruct (ShHandle handle)
 
COMPILER_EXPORT int ShFinalize ()
 
COMPILER_EXPORT void ShGetActiveAttrib (const ShHandle handle, int index, size_t *length, int *size, ShDataType *type, char *name, char *mappedName)
 
COMPILER_EXPORT void ShGetActiveUniform (const ShHandle handle, int index, size_t *length, int *size, ShDataType *type, char *name, char *mappedName)
 
COMPILER_EXPORT void ShGetInfo (const ShHandle handle, ShShaderInfo pname, size_t *params)
 
COMPILER_EXPORT void ShGetInfoLog (const ShHandle handle, char *infoLog)
 
COMPILER_EXPORT void ShGetInfoPointer (const ShHandle handle, ShShaderInfo pname, void **params)
 
COMPILER_EXPORT void ShGetNameHashingEntry (const ShHandle handle, int index, char *name, char *hashedName)
 
COMPILER_EXPORT void ShGetObjectCode (const ShHandle handle, char *objCode)
 
COMPILER_EXPORT void ShInitBuiltInResources (ShBuiltInResources *resources)
 
COMPILER_EXPORT int ShInitialize ()
 

Macro Definition Documentation

#define ANGLE_SH_VERSION   110

Definition at line 40 of file ShaderLang.h.

#define COMPILER_EXPORT

Definition at line 23 of file ShaderLang.h.

Typedef Documentation

typedef void* ShHandle

Definition at line 255 of file ShaderLang.h.

typedef khronos_uint64_t(* ShHashFunction64)(const char *, size_t)

Definition at line 197 of file ShaderLang.h.

Enumeration Type Documentation

Enumerator
SH_CLAMP_WITH_CLAMP_INTRINSIC 
SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION 

Definition at line 175 of file ShaderLang.h.

Enumerator
SH_VALIDATE 
SH_VALIDATE_LOOP_INDEXING 
SH_INTERMEDIATE_TREE 
SH_OBJECT_CODE 
SH_ATTRIBUTES_UNIFORMS 
SH_LINE_DIRECTIVES 
SH_SOURCE_PATH 
SH_MAP_LONG_VARIABLE_NAMES 
SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX 
SH_EMULATE_BUILT_IN_FUNCTIONS 
SH_TIMING_RESTRICTIONS 
SH_DEPENDENCY_GRAPH 
SH_ENFORCE_PACKING_RESTRICTIONS 
SH_CLAMP_INDIRECT_ARRAY_BOUNDS 
SH_LIMIT_EXPRESSION_COMPLEXITY 
SH_LIMIT_CALL_STACK_DEPTH 

Definition at line 126 of file ShaderLang.h.

enum ShDataType
Enumerator
SH_NONE 
SH_INT 
SH_FLOAT 
SH_FLOAT_VEC2 
SH_FLOAT_VEC3 
SH_FLOAT_VEC4 
SH_INT_VEC2 
SH_INT_VEC3 
SH_INT_VEC4 
SH_BOOL 
SH_BOOL_VEC2 
SH_BOOL_VEC3 
SH_BOOL_VEC4 
SH_FLOAT_MAT2 
SH_FLOAT_MAT3 
SH_FLOAT_MAT4 
SH_SAMPLER_2D 
SH_SAMPLER_CUBE 
SH_SAMPLER_2D_RECT_ARB 
SH_SAMPLER_EXTERNAL_OES 

Definition at line 88 of file ShaderLang.h.

Enumerator
SH_INFO_LOG_LENGTH 
SH_OBJECT_CODE_LENGTH 
SH_ACTIVE_UNIFORMS 
SH_ACTIVE_UNIFORM_MAX_LENGTH 
SH_ACTIVE_ATTRIBUTES 
SH_ACTIVE_ATTRIBUTE_MAX_LENGTH 
SH_MAPPED_NAME_MAX_LENGTH 
SH_NAME_MAX_LENGTH 
SH_HASHED_NAME_MAX_LENGTH 
SH_HASHED_NAMES_COUNT 
SH_ACTIVE_UNIFORMS_ARRAY 

Definition at line 111 of file ShaderLang.h.

Enumerator
SH_ESSL_OUTPUT 
SH_GLSL_OUTPUT 
SH_HLSL_OUTPUT 
SH_HLSL9_OUTPUT 
SH_HLSL11_OUTPUT 

Definition at line 80 of file ShaderLang.h.

Enumerator
SH_GLES2_SPEC 
SH_WEBGL_SPEC 
SH_CSS_SHADERS_SPEC 

Definition at line 53 of file ShaderLang.h.

Enumerator
SH_FRAGMENT_SHADER 
SH_VERTEX_SHADER 

Definition at line 48 of file ShaderLang.h.

Function Documentation

COMPILER_EXPORT int ShCompile ( const ShHandle  handle,
const char *const  shaderStrings[],
size_t  numStrings,
int  compileOptions 
)
COMPILER_EXPORT int ShFinalize ( )

Definition at line 100 of file ShaderLang.cpp.

References DetachProcess().

Referenced by main(), and Zeni::Video::Video().

COMPILER_EXPORT void ShGetActiveAttrib ( const ShHandle  handle,
int  index,
size_t length,
int size,
ShDataType type,
char *  name,
char *  mappedName 
)

Definition at line 280 of file ShaderLang.cpp.

References getVariableInfo(), and SH_ACTIVE_ATTRIBUTES.

Referenced by PrintActiveVariables().

COMPILER_EXPORT void ShGetActiveUniform ( const ShHandle  handle,
int  index,
size_t length,
int size,
ShDataType type,
char *  name,
char *  mappedName 
)

Definition at line 292 of file ShaderLang.cpp.

References getVariableInfo(), and SH_ACTIVE_UNIFORMS.

Referenced by PrintActiveVariables().

COMPILER_EXPORT void ShGetInfoLog ( const ShHandle  handle,
char *  infoLog 
)
COMPILER_EXPORT void ShGetInfoPointer ( const ShHandle  handle,
ShShaderInfo  pname,
void **  params 
)
COMPILER_EXPORT void ShGetNameHashingEntry ( const ShHandle  handle,
int  index,
char *  name,
char *  hashedName 
)
COMPILER_EXPORT void ShGetObjectCode ( const ShHandle  handle,
char *  objCode 
)
COMPILER_EXPORT int ShInitialize ( )

Definition at line 91 of file ShaderLang.cpp.

References InitProcess().

Referenced by main(), and Zeni::Video::Video().