27 size_t activeUniformLimit = 0;
29 size_t activeAttribLimit = 0;
31 return (expectedValue == activeUniformLimit && expectedValue == activeAttribLimit);
36 size_t mappedNameMaxLength = 0;
38 return (expectedValue == mappedNameMaxLength);
50 if (!handle || !size || !type || !name)
66 if (length) *length = varInfo.
name.size();
75 strncpy(name, varInfo.
name.c_str(), activeUniformAndAttribLength);
76 name[activeUniformAndAttribLength - 1] = 0;
82 strncpy(mappedName, varInfo.
mappedName.c_str(), maxMappedNameLength);
83 mappedName[maxMappedNameLength - 1] = 0;
94 return kInitialized ? 1 : 0;
150 if (!compiler->
Init(*resources)) {
155 return reinterpret_cast<void*
>(base);
178 const char*
const shaderStrings[],
190 bool success = compiler->
compile(shaderStrings, numStrings, compileOptions);
191 return success ? 1 : 0;
196 if (!handle || !params)
201 if (!compiler)
return;
238 *params = 16 +
sizeof(HashedNamePrefix);
253 if (!handle || !infoLog)
258 if (!compiler)
return;
269 if (!handle || !objCode)
274 if (!compiler)
return;
277 strcpy(objCode, infoSink.
obj.
c_str());
289 handle, index, length, size, type, name, mappedName);
301 handle, index, length, size, type, name, mappedName);
309 if (!handle || !name || !hashedName || index < 0)
314 if (!compiler)
return;
317 if (index >= static_cast<int>(nameMap.size()))
320 NameMap::const_iterator it = nameMap.begin();
324 size_t len = it->first.length() + 1;
331 strncpy(name, it->first.c_str(),
len);
333 name[len - 1] =
'\0';
335 len = it->second.length() + 1;
342 strncpy(hashedName, it->second.c_str(),
len);
344 hashedName[len - 1] =
'\0';
349 if (!handle || !params)
354 if (!translator)
return;
bool Init(const ShBuiltInResources &resources)
virtual TranslatorHLSL * getAsTranslatorHLSL()
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
COMPILER_EXPORT int ShCompile(const ShHandle handle, const char *const shaderStrings[], size_t numStrings, int compileOptions)
#define HASHED_NAME_PREFIX
int MaxVertexUniformVectors
COMPILER_EXPORT ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec, ShShaderOutput output, const ShBuiltInResources *resources)
int ARB_texture_rectangle
int MaxFragmentUniformVectors
std::map< TPersistString, TPersistString > NameMap
int MaxVertexTextureImageUnits
virtual TCompiler * getAsCompiler()
GLsizei GLsizei GLchar * infoLog
static void getVariableInfo(ShShaderInfo varType, const ShHandle handle, int index, size_t *length, int *size, ShDataType *type, char *name, char *mappedName)
EGLImageKHR EGLint * name
TInfoSink & getInfoSink()
COMPILER_EXPORT void ShGetInfoPointer(const ShHandle handle, ShShaderInfo pname, void **params)
TPersistString mappedName
ShHashFunction64 getHashFunction() const
#define ASSERT(expression)
COMPILER_EXPORT void ShGetActiveAttrib(const ShHandle handle, int index, size_t *length, int *size, ShDataType *type, char *name, char *mappedName)
TCompiler * ConstructCompiler(ShShaderType type, ShShaderSpec spec, ShShaderOutput output)
ShArrayIndexClampingStrategy ArrayIndexClampingStrategy
const sh::ActiveUniforms & getUniforms()
static bool checkActiveUniformAndAttribMaxLengths(const ShHandle handle, size_t expectedValue)
COMPILER_EXPORT void ShDestruct(ShHandle handle)
COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources *resources)
COMPILER_EXPORT int ShFinalize()
COMPILER_EXPORT void ShGetInfoLog(const ShHandle handle, char *infoLog)
COMPILER_EXPORT void ShGetObjectCode(const ShHandle handle, char *objCode)
void DeleteCompiler(TCompiler *compiler)
int MaxCombinedTextureImageUnits
COMPILER_EXPORT void ShGetInfo(const ShHandle handle, ShShaderInfo pname, size_t *params)
static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue)
COMPILER_EXPORT int ShInitialize()
std::vector< TVariableInfo > TVariableInfoList
COMPILER_EXPORT void ShGetNameHashingEntry(const ShHandle handle, int index, char *name, char *hashedName)
#define MAX_SYMBOL_NAME_LEN
EGLImageKHR EGLint EGLint * handle
const char * c_str() const
const TVariableInfoList & getUniforms() const
int OES_EGL_image_external
bool compile(const char *const shaderStrings[], size_t numStrings, int compileOptions)
COMPILER_EXPORT void ShGetActiveUniform(const ShHandle handle, int index, size_t *length, int *size, ShDataType *type, char *name, char *mappedName)
const TVariableInfoList & getAttribs() const
int FragmentPrecisionHigh
int OES_standard_derivatives
ShHashFunction64 HashFunction