zenilib: zenilib/jni/external/angle/include/GLSLANG/ShaderLang.h File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
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 void * | ShHandle
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

enum ShArrayIndexClampingStrategy

Enumerator
SH_CLAMP_WITH_CLAMP_INTRINSIC |
SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION |

Definition at line 175 of file ShaderLang.h.

enum ShCompileOptions

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.

enum ShShaderInfo

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.

enum ShShaderOutput

Enumerator
SH_ESSL_OUTPUT |
SH_GLSL_OUTPUT |
SH_HLSL_OUTPUT |
SH_HLSL9_OUTPUT |
SH_HLSL11_OUTPUT |

Definition at line 80 of file ShaderLang.h.

enum ShShaderSpec

Enumerator
SH_GLES2_SPEC |
SH_WEBGL_SPEC |
SH_CSS_SHADERS_SPEC |

Definition at line 53 of file ShaderLang.h.

enum ShShaderType

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
| ) |  |

Definition at line 176 of file ShaderLang.cpp.

References TCompiler::compile(), and TShHandleBase::getAsCompiler().

Referenced by Zeni::Video::compile_glsles_shader(), and CompileFile().

COMPILER_EXPORT ShHandle ShConstructCompiler | ( | ShShaderType | type,
|  | ShShaderSpec | spec,
|  | ShShaderOutput | output,
|  | const ShBuiltInResources * | resources
| ) |  |

Definition at line 140 of file ShaderLang.cpp.

References ConstructCompiler(), TShHandleBase::getAsCompiler(), TCompiler::Init(), and ShDestruct().

Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_GL_Fixed::init(), Zeni::Video_DX9::init_device(), and main().

COMPILER_EXPORT void ShDestruct | ( | ShHandle | handle | ) |

Definition at line 158 of file ShaderLang.cpp.

References DeleteCompiler(), and TShHandleBase::getAsCompiler().

Referenced by Zeni::Video_DX9::destroy_device(), main(), ShConstructCompiler(), Zeni::Video_GL_Shader::uninit(), and Zeni::Video_GL_Fixed::uninit().

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 ShGetInfo | ( | const ShHandle | handle,
|  | ShShaderInfo | pname,
|  | size_t * | params
| ) |  |

Definition at line 194 of file ShaderLang.cpp.

References TShHandleBase::getAsCompiler(), TCompiler::getAttribs(), TCompiler::getHashFunction(), TCompiler::getInfoSink(), TCompiler::getNameMap(), TCompiler::getUniforms(), HASHED_NAME_PREFIX, TInfoSink::info, MAX_SYMBOL_NAME_LEN, NULL, TInfoSink::obj, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, SH_ACTIVE_ATTRIBUTES, SH_ACTIVE_UNIFORM_MAX_LENGTH, SH_ACTIVE_UNIFORMS, SH_HASHED_NAME_MAX_LENGTH, SH_HASHED_NAMES_COUNT, SH_INFO_LOG_LENGTH, SH_MAPPED_NAME_MAX_LENGTH, SH_NAME_MAX_LENGTH, SH_OBJECT_CODE_LENGTH, TInfoSinkBase::size(), and UNREACHABLE.

Referenced by checkActiveUniformAndAttribMaxLengths(), checkMappedNameMaxLength(), Zeni::Video::compile_glsles_shader(), main(), PrintActiveVariables(), and ShGetNameHashingEntry().

COMPILER_EXPORT void ShGetInfoLog | ( | const ShHandle | handle,
|  | char * | infoLog
| ) |  |

Definition at line 251 of file ShaderLang.cpp.

References TInfoSinkBase::c_str(), TShHandleBase::getAsCompiler(), TCompiler::getInfoSink(), and TInfoSink::info.

Referenced by main().

COMPILER_EXPORT void ShGetInfoPointer | ( | const ShHandle | handle,
|  | ShShaderInfo | pname,
|  | void ** | params
| ) |  |

Definition at line 347 of file ShaderLang.cpp.

References TShHandleBase::getAsTranslatorHLSL(), TranslatorHLSL::getUniforms(), SH_ACTIVE_UNIFORMS_ARRAY, and UNREACHABLE.

COMPILER_EXPORT void ShGetNameHashingEntry | ( | const ShHandle | handle,
|  | int | index,
|  | char * | name,
|  | char * | hashedName
| ) |  |

Definition at line 304 of file ShaderLang.cpp.

References ASSERT, TShHandleBase::getAsCompiler(), TCompiler::getNameMap(), i, SH_HASHED_NAME_MAX_LENGTH, SH_NAME_MAX_LENGTH, and ShGetInfo().

COMPILER_EXPORT void ShGetObjectCode | ( | const ShHandle | handle,
|  | char * | objCode
| ) |  |

Definition at line 267 of file ShaderLang.cpp.

References TInfoSinkBase::c_str(), TShHandleBase::getAsCompiler(), TCompiler::getInfoSink(), and TInfoSink::obj.

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

COMPILER_EXPORT void ShInitBuiltInResources | ( | ShBuiltInResources * | resources | ) |

Definition at line 109 of file ShaderLang.cpp.

References ShBuiltInResources::ARB_texture_rectangle, ShBuiltInResources::ArrayIndexClampingStrategy, ShBuiltInResources::EXT_draw_buffers, ShBuiltInResources::EXT_frag_depth, ShBuiltInResources::FragmentPrecisionHigh, ShBuiltInResources::HashFunction, ShBuiltInResources::MaxCombinedTextureImageUnits, ShBuiltInResources::MaxDrawBuffers, ShBuiltInResources::MaxFragmentUniformVectors, ShBuiltInResources::MaxTextureImageUnits, ShBuiltInResources::MaxVaryingVectors, ShBuiltInResources::MaxVertexAttribs, ShBuiltInResources::MaxVertexTextureImageUnits, ShBuiltInResources::MaxVertexUniformVectors, NULL, ShBuiltInResources::OES_EGL_image_external, ShBuiltInResources::OES_standard_derivatives, and SH_CLAMP_WITH_CLAMP_INTRINSIC.

Referenced by GenerateResources(), Zeni::Video_GL_Shader::init(), Zeni::Video_GL_Fixed::init(), and Zeni::Video_DX9::init_device().

COMPILER_EXPORT int ShInitialize | ( |  | ) |

Definition at line 91 of file ShaderLang.cpp.

References InitProcess().

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