Commit 18591b7c by Geoff Lang Committed by Shannon Woods

Capitalized the first letter of all private format util functions.

TRAC #23212 Signed-off-by: Shannon Woods Author: Geoff Lang
parent 2e1dcd59
...@@ -24,98 +24,98 @@ typedef std::pair<FormatTypePair, GLint> FormatPair; ...@@ -24,98 +24,98 @@ typedef std::pair<FormatTypePair, GLint> FormatPair;
typedef std::map<FormatTypePair, GLint> FormatMap; typedef std::map<FormatTypePair, GLint> FormatMap;
// A helper function to insert data into the D3D11LoadFunctionMap with fewer characters. // A helper function to insert data into the D3D11LoadFunctionMap with fewer characters.
static inline void insertFormatMapping(FormatMap *map, GLenum format, GLenum type, GLint internalFormat) static inline void InsertFormatMapping(FormatMap *map, GLenum format, GLenum type, GLint internalFormat)
{ {
map->insert(FormatPair(FormatTypePair(format, type), internalFormat)); map->insert(FormatPair(FormatTypePair(format, type), internalFormat));
} }
FormatMap buildES2FormatMap() FormatMap BuildES2FormatMap()
{ {
FormatMap map; FormatMap map;
// | Format | Type | Internal format | // | Format | Type | Internal format |
insertFormatMapping(&map, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA8_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA8_EXT );
insertFormatMapping(&map, GL_ALPHA, GL_FLOAT, GL_ALPHA32F_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_FLOAT, GL_ALPHA32F_EXT );
insertFormatMapping(&map, GL_ALPHA, GL_HALF_FLOAT_OES, GL_ALPHA16F_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_HALF_FLOAT_OES, GL_ALPHA16F_EXT );
insertFormatMapping(&map, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE8_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE8_EXT );
insertFormatMapping(&map, GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE32F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE32F_EXT );
insertFormatMapping(&map, GL_LUMINANCE, GL_HALF_FLOAT_OES, GL_LUMINANCE16F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_HALF_FLOAT_OES, GL_LUMINANCE16F_EXT );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE8_ALPHA8_EXT ); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE8_ALPHA8_EXT );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA32F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA32F_EXT );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES, GL_LUMINANCE_ALPHA16F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES, GL_LUMINANCE_ALPHA16F_EXT );
insertFormatMapping(&map, GL_RGB, GL_UNSIGNED_BYTE, GL_RGB8_OES ); InsertFormatMapping(&map, GL_RGB, GL_UNSIGNED_BYTE, GL_RGB8_OES );
insertFormatMapping(&map, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB565 ); InsertFormatMapping(&map, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB565 );
insertFormatMapping(&map, GL_RGB, GL_FLOAT, GL_RGB32F_EXT ); InsertFormatMapping(&map, GL_RGB, GL_FLOAT, GL_RGB32F_EXT );
insertFormatMapping(&map, GL_RGB, GL_HALF_FLOAT_OES, GL_RGB16F_EXT ); InsertFormatMapping(&map, GL_RGB, GL_HALF_FLOAT_OES, GL_RGB16F_EXT );
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_BYTE, GL_RGBA8_OES ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_BYTE, GL_RGBA8_OES );
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA4 ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA4 );
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, GL_RGB5_A1 ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, GL_RGB5_A1 );
insertFormatMapping(&map, GL_RGBA, GL_FLOAT, GL_RGBA32F_EXT ); InsertFormatMapping(&map, GL_RGBA, GL_FLOAT, GL_RGBA32F_EXT );
insertFormatMapping(&map, GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA16F_EXT ); InsertFormatMapping(&map, GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA16F_EXT );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA8_EXT ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA8_EXT );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_BGR5_A1_ANGLEX ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_BGR5_A1_ANGLEX );
insertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGB_S3TC_DXT1_EXT ); InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGB_S3TC_DXT1_EXT );
insertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT );
insertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE);
insertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE);
insertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16 ); InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16 );
insertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT32_OES ); InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT32_OES );
insertFormatMapping(&map, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, GL_DEPTH24_STENCIL8_OES ); InsertFormatMapping(&map, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, GL_DEPTH24_STENCIL8_OES );
return map; return map;
} }
static const FormatMap &getES2FormatMap() static const FormatMap &GetES2FormatMap()
{ {
static const FormatMap es2FormatMap = buildES2FormatMap(); static const FormatMap es2FormatMap = BuildES2FormatMap();
return es2FormatMap; return es2FormatMap;
} }
FormatMap buildES3FormatMap() FormatMap BuildES3FormatMap()
{ {
FormatMap map; FormatMap map;
// | Format | Type | Internal format | // | Format | Type | Internal format |
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_BYTE, GL_RGBA8 ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_BYTE, GL_RGBA8 );
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA4 ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, GL_RGBA4 );
insertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, GL_RGB5_A1 ); InsertFormatMapping(&map, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, GL_RGB5_A1 );
insertFormatMapping(&map, GL_RGBA, GL_FLOAT, GL_RGBA32F ); InsertFormatMapping(&map, GL_RGBA, GL_FLOAT, GL_RGBA32F );
insertFormatMapping(&map, GL_RGBA, GL_HALF_FLOAT, GL_RGBA16F ); InsertFormatMapping(&map, GL_RGBA, GL_HALF_FLOAT, GL_RGBA16F );
insertFormatMapping(&map, GL_RGB, GL_UNSIGNED_BYTE, GL_RGB8 ); InsertFormatMapping(&map, GL_RGB, GL_UNSIGNED_BYTE, GL_RGB8 );
insertFormatMapping(&map, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB565 ); InsertFormatMapping(&map, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB565 );
insertFormatMapping(&map, GL_RGB, GL_FLOAT, GL_RGB32F ); InsertFormatMapping(&map, GL_RGB, GL_FLOAT, GL_RGB32F );
insertFormatMapping(&map, GL_RGB, GL_HALF_FLOAT, GL_RGB16F ); InsertFormatMapping(&map, GL_RGB, GL_HALF_FLOAT, GL_RGB16F );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE8_ALPHA8_EXT ); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE8_ALPHA8_EXT );
insertFormatMapping(&map, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE8_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE8_EXT );
insertFormatMapping(&map, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA8_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA8_EXT );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA32F_EXT); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_FLOAT, GL_LUMINANCE_ALPHA32F_EXT);
insertFormatMapping(&map, GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE32F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_FLOAT, GL_LUMINANCE32F_EXT );
insertFormatMapping(&map, GL_ALPHA, GL_FLOAT, GL_ALPHA32F_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_FLOAT, GL_ALPHA32F_EXT );
insertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT, GL_LUMINANCE_ALPHA16F_EXT); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT, GL_LUMINANCE_ALPHA16F_EXT);
insertFormatMapping(&map, GL_LUMINANCE, GL_HALF_FLOAT, GL_LUMINANCE16F_EXT ); InsertFormatMapping(&map, GL_LUMINANCE, GL_HALF_FLOAT, GL_LUMINANCE16F_EXT );
insertFormatMapping(&map, GL_ALPHA, GL_HALF_FLOAT, GL_ALPHA16F_EXT ); InsertFormatMapping(&map, GL_ALPHA, GL_HALF_FLOAT, GL_ALPHA16F_EXT );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA8_EXT ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA8_EXT );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX );
insertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_BGR5_A1_ANGLEX ); InsertFormatMapping(&map, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_BGR5_A1_ANGLEX );
insertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16 ); InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16 );
insertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT24 ); InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT24 );
insertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F ); InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F );
insertFormatMapping(&map, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8 ); InsertFormatMapping(&map, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8 );
insertFormatMapping(&map, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_DEPTH32F_STENCIL8 ); InsertFormatMapping(&map, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_DEPTH32F_STENCIL8 );
return map; return map;
} }
...@@ -138,7 +138,7 @@ struct FormatInfo ...@@ -138,7 +138,7 @@ struct FormatInfo
// ES3 has a specific set of permutations of internal formats, formats and types which are acceptable. // ES3 has a specific set of permutations of internal formats, formats and types which are acceptable.
typedef std::set<FormatInfo> ES3FormatSet; typedef std::set<FormatInfo> ES3FormatSet;
ES3FormatSet buildES3FormatSet() ES3FormatSet BuildES3FormatSet()
{ {
ES3FormatSet set; ES3FormatSet set;
...@@ -288,9 +288,9 @@ ES3FormatSet buildES3FormatSet() ...@@ -288,9 +288,9 @@ ES3FormatSet buildES3FormatSet()
return set; return set;
} }
static const ES3FormatSet &getES3FormatSet() static const ES3FormatSet &GetES3FormatSet()
{ {
static const ES3FormatSet es3FormatSet = buildES3FormatSet(); static const ES3FormatSet es3FormatSet = BuildES3FormatSet();
return es3FormatSet; return es3FormatSet;
} }
...@@ -315,7 +315,7 @@ struct TypeInfo ...@@ -315,7 +315,7 @@ struct TypeInfo
typedef std::pair<GLenum, TypeInfo> TypeInfoPair; typedef std::pair<GLenum, TypeInfo> TypeInfoPair;
typedef std::map<GLenum, TypeInfo> TypeInfoMap; typedef std::map<GLenum, TypeInfo> TypeInfoMap;
static TypeInfoMap buildTypeInfoMap() static TypeInfoMap BuildTypeInfoMap()
{ {
TypeInfoMap map; TypeInfoMap map;
...@@ -342,9 +342,9 @@ static TypeInfoMap buildTypeInfoMap() ...@@ -342,9 +342,9 @@ static TypeInfoMap buildTypeInfoMap()
return map; return map;
} }
static bool getTypeInfo(GLenum type, TypeInfo *outTypeInfo) static bool GetTypeInfo(GLenum type, TypeInfo *outTypeInfo)
{ {
static const TypeInfoMap infoMap = buildTypeInfoMap(); static const TypeInfoMap infoMap = BuildTypeInfoMap();
TypeInfoMap::const_iterator iter = infoMap.find(type); TypeInfoMap::const_iterator iter = infoMap.find(type);
if (iter != infoMap.end()) if (iter != infoMap.end())
{ {
...@@ -571,7 +571,7 @@ struct InternalFormatInfo ...@@ -571,7 +571,7 @@ struct InternalFormatInfo
typedef std::pair<GLuint, InternalFormatInfo> InternalFormatInfoPair; typedef std::pair<GLuint, InternalFormatInfo> InternalFormatInfoPair;
typedef std::map<GLuint, InternalFormatInfo> InternalFormatInfoMap; typedef std::map<GLuint, InternalFormatInfo> InternalFormatInfoMap;
static InternalFormatInfoMap buildES3InternalFormatInfoMap() static InternalFormatInfoMap BuildES3InternalFormatInfoMap()
{ {
InternalFormatInfoMap map; InternalFormatInfoMap map;
...@@ -699,7 +699,7 @@ static InternalFormatInfoMap buildES3InternalFormatInfoMap() ...@@ -699,7 +699,7 @@ static InternalFormatInfoMap buildES3InternalFormatInfoMap()
return map; return map;
} }
static InternalFormatInfoMap buildES2InternalFormatInfoMap() static InternalFormatInfoMap BuildES2InternalFormatInfoMap()
{ {
InternalFormatInfoMap map; InternalFormatInfoMap map;
...@@ -775,18 +775,18 @@ static InternalFormatInfoMap buildES2InternalFormatInfoMap() ...@@ -775,18 +775,18 @@ static InternalFormatInfoMap buildES2InternalFormatInfoMap()
return map; return map;
} }
static bool getInternalFormatInfo(GLint internalFormat, GLuint clientVersion, InternalFormatInfo *outFormatInfo) static bool GetInternalFormatInfo(GLint internalFormat, GLuint clientVersion, InternalFormatInfo *outFormatInfo)
{ {
const InternalFormatInfoMap* map = NULL; const InternalFormatInfoMap* map = NULL;
if (clientVersion == 2) if (clientVersion == 2)
{ {
static const InternalFormatInfoMap formatMap = buildES2InternalFormatInfoMap(); static const InternalFormatInfoMap formatMap = BuildES2InternalFormatInfoMap();
map = &formatMap; map = &formatMap;
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const InternalFormatInfoMap formatMap = buildES3InternalFormatInfoMap(); static const InternalFormatInfoMap formatMap = BuildES3InternalFormatInfoMap();
map = &formatMap; map = &formatMap;
} }
else else
...@@ -811,9 +811,9 @@ static bool getInternalFormatInfo(GLint internalFormat, GLuint clientVersion, In ...@@ -811,9 +811,9 @@ static bool getInternalFormatInfo(GLint internalFormat, GLuint clientVersion, In
typedef std::set<GLenum> FormatSet; typedef std::set<GLenum> FormatSet;
static FormatSet buildES2ValidFormatSet() static FormatSet BuildES2ValidFormatSet()
{ {
static const FormatMap &formatMap = getES2FormatMap(); static const FormatMap &formatMap = GetES2FormatMap();
FormatSet set; FormatSet set;
...@@ -826,9 +826,9 @@ static FormatSet buildES2ValidFormatSet() ...@@ -826,9 +826,9 @@ static FormatSet buildES2ValidFormatSet()
return set; return set;
} }
static FormatSet buildES3ValidFormatSet() static FormatSet BuildES3ValidFormatSet()
{ {
static const ES3FormatSet &formatSet = getES3FormatSet(); static const ES3FormatSet &formatSet = GetES3FormatSet();
FormatSet set; FormatSet set;
...@@ -843,9 +843,9 @@ static FormatSet buildES3ValidFormatSet() ...@@ -843,9 +843,9 @@ static FormatSet buildES3ValidFormatSet()
typedef std::set<GLenum> TypeSet; typedef std::set<GLenum> TypeSet;
static TypeSet buildES2ValidTypeSet() static TypeSet BuildES2ValidTypeSet()
{ {
static const FormatMap &formatMap = getES2FormatMap(); static const FormatMap &formatMap = GetES2FormatMap();
TypeSet set; TypeSet set;
...@@ -858,9 +858,9 @@ static TypeSet buildES2ValidTypeSet() ...@@ -858,9 +858,9 @@ static TypeSet buildES2ValidTypeSet()
return set; return set;
} }
static TypeSet buildES3ValidTypeSet() static TypeSet BuildES3ValidTypeSet()
{ {
static const ES3FormatSet &formatSet = getES3FormatSet(); static const ES3FormatSet &formatSet = GetES3FormatSet();
TypeSet set; TypeSet set;
...@@ -889,7 +889,7 @@ struct CopyConversion ...@@ -889,7 +889,7 @@ struct CopyConversion
typedef std::set<CopyConversion> CopyConversionSet; typedef std::set<CopyConversion> CopyConversionSet;
static CopyConversionSet buildValidES3CopyTexImageCombinations() static CopyConversionSet BuildValidES3CopyTexImageCombinations()
{ {
CopyConversionSet set; CopyConversionSet set;
...@@ -933,7 +933,7 @@ bool IsValidInternalFormat(GLint internalFormat, const Context *context) ...@@ -933,7 +933,7 @@ bool IsValidInternalFormat(GLint internalFormat, const Context *context)
} }
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo))
{ {
ASSERT(internalFormatInfo.mSupportFunction != NULL); ASSERT(internalFormatInfo.mSupportFunction != NULL);
return internalFormatInfo.mSupportFunction(context); return internalFormatInfo.mSupportFunction(context);
...@@ -948,12 +948,12 @@ bool IsValidFormat(GLenum format, GLuint clientVersion) ...@@ -948,12 +948,12 @@ bool IsValidFormat(GLenum format, GLuint clientVersion)
{ {
if (clientVersion == 2) if (clientVersion == 2)
{ {
static const FormatSet formatSet = buildES2ValidFormatSet(); static const FormatSet formatSet = BuildES2ValidFormatSet();
return formatSet.find(format) != formatSet.end(); return formatSet.find(format) != formatSet.end();
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const FormatSet formatSet = buildES3ValidFormatSet(); static const FormatSet formatSet = BuildES3ValidFormatSet();
return formatSet.find(format) != formatSet.end(); return formatSet.find(format) != formatSet.end();
} }
else else
...@@ -967,12 +967,12 @@ bool IsValidType(GLenum type, GLuint clientVersion) ...@@ -967,12 +967,12 @@ bool IsValidType(GLenum type, GLuint clientVersion)
{ {
if (clientVersion == 2) if (clientVersion == 2)
{ {
static const TypeSet typeSet = buildES2ValidTypeSet(); static const TypeSet typeSet = BuildES2ValidTypeSet();
return typeSet.find(type) != typeSet.end(); return typeSet.find(type) != typeSet.end();
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const TypeSet typeSet = buildES3ValidTypeSet(); static const TypeSet typeSet = BuildES3ValidTypeSet();
return typeSet.find(type) != typeSet.end(); return typeSet.find(type) != typeSet.end();
} }
else else
...@@ -986,14 +986,14 @@ bool IsValidFormatCombination(GLint internalFormat, GLenum format, GLenum type, ...@@ -986,14 +986,14 @@ bool IsValidFormatCombination(GLint internalFormat, GLenum format, GLenum type,
{ {
if (clientVersion == 2) if (clientVersion == 2)
{ {
static const FormatMap &formats = getES2FormatMap(); static const FormatMap &formats = GetES2FormatMap();
FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type)); FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
return (iter != formats.end()) && ((internalFormat == (GLint)type) || (internalFormat == iter->second)); return (iter != formats.end()) && ((internalFormat == (GLint)type) || (internalFormat == iter->second));
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const ES3FormatSet &formats = getES3FormatSet(); static const ES3FormatSet &formats = GetES3FormatSet();
return formats.find(FormatInfo(internalFormat, format, type)) != formats.end(); return formats.find(FormatInfo(internalFormat, format, type)) != formats.end();
} }
else else
...@@ -1007,8 +1007,8 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu ...@@ -1007,8 +1007,8 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
{ {
InternalFormatInfo textureInternalFormatInfo; InternalFormatInfo textureInternalFormatInfo;
InternalFormatInfo framebufferInternalFormatInfo; InternalFormatInfo framebufferInternalFormatInfo;
if (getInternalFormatInfo(textureInternalFormat, clientVersion, &textureInternalFormatInfo) && if (GetInternalFormatInfo(textureInternalFormat, clientVersion, &textureInternalFormatInfo) &&
getInternalFormatInfo(frameBufferInternalFormat, clientVersion, &framebufferInternalFormatInfo)) GetInternalFormatInfo(frameBufferInternalFormat, clientVersion, &framebufferInternalFormatInfo))
{ {
if (clientVersion == 2) if (clientVersion == 2)
{ {
...@@ -1017,7 +1017,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu ...@@ -1017,7 +1017,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const CopyConversionSet conversionSet = buildValidES3CopyTexImageCombinations(); static const CopyConversionSet conversionSet = BuildValidES3CopyTexImageCombinations();
const CopyConversion conversion = CopyConversion(textureInternalFormatInfo.mFormat, const CopyConversion conversion = CopyConversion(textureInternalFormatInfo.mFormat,
framebufferInternalFormatInfo.mFormat); framebufferInternalFormatInfo.mFormat);
if (conversionSet.find(conversion) != conversionSet.end()) if (conversionSet.find(conversion) != conversionSet.end())
...@@ -1062,7 +1062,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu ...@@ -1062,7 +1062,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
bool IsSizedInternalFormat(GLint internalFormat, GLuint clientVersion) bool IsSizedInternalFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mPixelBits > 0; return internalFormatInfo.mPixelBits > 0;
} }
...@@ -1077,13 +1077,13 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion) ...@@ -1077,13 +1077,13 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion)
{ {
if (clientVersion == 2) if (clientVersion == 2)
{ {
static const FormatMap &formats = getES2FormatMap(); static const FormatMap &formats = GetES2FormatMap();
FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type)); FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
return (iter != formats.end()) ? iter->second : GL_NONE; return (iter != formats.end()) ? iter->second : GL_NONE;
} }
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
static const FormatMap formats = buildES3FormatMap(); static const FormatMap formats = BuildES3FormatMap();
FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type)); FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
return (iter != formats.end()) ? iter->second : GL_NONE; return (iter != formats.end()) ? iter->second : GL_NONE;
} }
...@@ -1097,7 +1097,7 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion) ...@@ -1097,7 +1097,7 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion)
GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion) GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mPixelBits / 8; return internalFormatInfo.mPixelBits / 8;
} }
...@@ -1111,7 +1111,7 @@ GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion) ...@@ -1111,7 +1111,7 @@ GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion)
GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion) GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mAlphaBits; return internalFormatInfo.mAlphaBits;
} }
...@@ -1125,7 +1125,7 @@ GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion) ...@@ -1125,7 +1125,7 @@ GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion)
GLuint GetRedBits(GLint internalFormat, GLuint clientVersion) GLuint GetRedBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mRedBits; return internalFormatInfo.mRedBits;
} }
...@@ -1139,7 +1139,7 @@ GLuint GetRedBits(GLint internalFormat, GLuint clientVersion) ...@@ -1139,7 +1139,7 @@ GLuint GetRedBits(GLint internalFormat, GLuint clientVersion)
GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion) GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mGreenBits; return internalFormatInfo.mGreenBits;
} }
...@@ -1153,7 +1153,7 @@ GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion) ...@@ -1153,7 +1153,7 @@ GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion)
GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion) GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mGreenBits; return internalFormatInfo.mGreenBits;
} }
...@@ -1167,7 +1167,7 @@ GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion) ...@@ -1167,7 +1167,7 @@ GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion)
GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion) GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mLuminanceBits; return internalFormatInfo.mLuminanceBits;
} }
...@@ -1181,7 +1181,7 @@ GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion) ...@@ -1181,7 +1181,7 @@ GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion)
GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion) GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mDepthBits; return internalFormatInfo.mDepthBits;
} }
...@@ -1195,7 +1195,7 @@ GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion) ...@@ -1195,7 +1195,7 @@ GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion)
GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion) GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStencilBits; return internalFormatInfo.mStencilBits;
} }
...@@ -1209,7 +1209,7 @@ GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion) ...@@ -1209,7 +1209,7 @@ GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion)
GLenum GetFormat(GLint internalFormat, GLuint clientVersion) GLenum GetFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mFormat; return internalFormatInfo.mFormat;
} }
...@@ -1223,7 +1223,7 @@ GLenum GetFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1223,7 +1223,7 @@ GLenum GetFormat(GLint internalFormat, GLuint clientVersion)
GLenum GetType(GLint internalFormat, GLuint clientVersion) GLenum GetType(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mType; return internalFormatInfo.mType;
} }
...@@ -1237,7 +1237,7 @@ GLenum GetType(GLint internalFormat, GLuint clientVersion) ...@@ -1237,7 +1237,7 @@ GLenum GetType(GLint internalFormat, GLuint clientVersion)
bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion) bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == NormalizedFixedPoint; return internalFormatInfo.mStorageType == NormalizedFixedPoint;
} }
...@@ -1251,7 +1251,7 @@ bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1251,7 +1251,7 @@ bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion)
bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion) bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == UnsignedInteger || return internalFormatInfo.mStorageType == UnsignedInteger ||
internalFormatInfo.mStorageType == SignedInteger; internalFormatInfo.mStorageType == SignedInteger;
...@@ -1266,7 +1266,7 @@ bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1266,7 +1266,7 @@ bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion) bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == SignedInteger; return internalFormatInfo.mStorageType == SignedInteger;
} }
...@@ -1280,7 +1280,7 @@ bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1280,7 +1280,7 @@ bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion) bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == UnsignedInteger; return internalFormatInfo.mStorageType == UnsignedInteger;
} }
...@@ -1294,7 +1294,7 @@ bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1294,7 +1294,7 @@ bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion) bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == FloatingPoint; return internalFormatInfo.mStorageType == FloatingPoint;
} }
...@@ -1308,7 +1308,7 @@ bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1308,7 +1308,7 @@ bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion)
bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion) bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mIsSRGB; return internalFormatInfo.mIsSRGB;
} }
...@@ -1322,7 +1322,7 @@ bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion) ...@@ -1322,7 +1322,7 @@ bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion)
bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *renderer) bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *renderer)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (renderer && getInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo)) if (renderer && GetInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsColorRenderable(NULL, renderer); return internalFormatInfo.mIsColorRenderable(NULL, renderer);
} }
...@@ -1336,7 +1336,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *rendere ...@@ -1336,7 +1336,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *rendere
bool IsColorRenderingSupported(GLint internalFormat, const Context *context) bool IsColorRenderingSupported(GLint internalFormat, const Context *context)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (context && getInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo)) if (context && GetInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsColorRenderable(context, NULL); return internalFormatInfo.mIsColorRenderable(context, NULL);
} }
...@@ -1350,7 +1350,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const Context *context) ...@@ -1350,7 +1350,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const Context *context)
bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *renderer) bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *renderer)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (renderer && getInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo)) if (renderer && GetInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsTextureFilterable(NULL, renderer); return internalFormatInfo.mIsTextureFilterable(NULL, renderer);
} }
...@@ -1364,7 +1364,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *rende ...@@ -1364,7 +1364,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *rende
bool IsTextureFilteringSupported(GLint internalFormat, const Context *context) bool IsTextureFilteringSupported(GLint internalFormat, const Context *context)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (context && getInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo)) if (context && GetInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsTextureFilterable(context, NULL); return internalFormatInfo.mIsTextureFilterable(context, NULL);
} }
...@@ -1378,7 +1378,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const Context *context) ...@@ -1378,7 +1378,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const Context *context)
bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *renderer) bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *renderer)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (renderer && getInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo)) if (renderer && GetInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsDepthRenderable(NULL, renderer); return internalFormatInfo.mIsDepthRenderable(NULL, renderer);
} }
...@@ -1392,7 +1392,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *rendere ...@@ -1392,7 +1392,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *rendere
bool IsDepthRenderingSupported(GLint internalFormat, const Context *context) bool IsDepthRenderingSupported(GLint internalFormat, const Context *context)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (context && getInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo)) if (context && GetInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsDepthRenderable(context, NULL); return internalFormatInfo.mIsDepthRenderable(context, NULL);
} }
...@@ -1406,7 +1406,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const Context *context) ...@@ -1406,7 +1406,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const Context *context)
bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *renderer) bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *renderer)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (renderer && getInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo)) if (renderer && GetInternalFormatInfo(internalFormat, renderer->getCurrentClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsStencilRenderable(NULL, renderer); return internalFormatInfo.mIsStencilRenderable(NULL, renderer);
} }
...@@ -1420,7 +1420,7 @@ bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *rende ...@@ -1420,7 +1420,7 @@ bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *rende
bool IsStencilRenderingSupported(GLint internalFormat, const Context *context) bool IsStencilRenderingSupported(GLint internalFormat, const Context *context)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (context && getInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo)) if (context && GetInternalFormatInfo(internalFormat, context->getClientVersion(), &internalFormatInfo))
{ {
return internalFormatInfo.mIsStencilRenderable(context, NULL); return internalFormatInfo.mIsStencilRenderable(context, NULL);
} }
...@@ -1445,7 +1445,7 @@ GLuint GetDepthPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GL ...@@ -1445,7 +1445,7 @@ GLuint GetDepthPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GL
GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height) GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
if (internalFormatInfo.mStorageType == Compressed) if (internalFormatInfo.mStorageType == Compressed)
{ {
...@@ -1457,7 +1457,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs ...@@ -1457,7 +1457,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs
else else
{ {
TypeInfo typeInfo; TypeInfo typeInfo;
if (getTypeInfo(type, &typeInfo)) if (GetTypeInfo(type, &typeInfo))
{ {
if (typeInfo.mSpecialInterpretation) if (typeInfo.mSpecialInterpretation)
{ {
...@@ -1485,7 +1485,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs ...@@ -1485,7 +1485,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs
bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion) bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mStorageType == Compressed; return internalFormatInfo.mStorageType == Compressed;
} }
...@@ -1499,7 +1499,7 @@ bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion) ...@@ -1499,7 +1499,7 @@ bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion)
GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion) GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mCompressedBlockWidth; return internalFormatInfo.mCompressedBlockWidth;
} }
...@@ -1513,7 +1513,7 @@ GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion) ...@@ -1513,7 +1513,7 @@ GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion)
GLuint GetCompressedBlockHeight(GLint internalFormat, GLuint clientVersion) GLuint GetCompressedBlockHeight(GLint internalFormat, GLuint clientVersion)
{ {
InternalFormatInfo internalFormatInfo; InternalFormatInfo internalFormatInfo;
if (getInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo)) if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
{ {
return internalFormatInfo.mCompressedBlockHeight; return internalFormatInfo.mCompressedBlockHeight;
} }
......
...@@ -37,7 +37,7 @@ struct D3D11ES3FormatInfo ...@@ -37,7 +37,7 @@ struct D3D11ES3FormatInfo
typedef std::pair<GLint, D3D11ES3FormatInfo> D3D11ES3FormatPair; typedef std::pair<GLint, D3D11ES3FormatInfo> D3D11ES3FormatPair;
typedef std::map<GLint, D3D11ES3FormatInfo> D3D11ES3FormatMap; typedef std::map<GLint, D3D11ES3FormatInfo> D3D11ES3FormatMap;
static D3D11ES3FormatMap buildD3D11ES3FormatMap() static D3D11ES3FormatMap BuildD3D11ES3FormatMap()
{ {
D3D11ES3FormatMap map; D3D11ES3FormatMap map;
...@@ -152,9 +152,9 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap() ...@@ -152,9 +152,9 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
return map; return map;
} }
static bool getD3D11ES3FormatInfo(GLint internalFormat, GLuint clientVersion, D3D11ES3FormatInfo *outFormatInfo) static bool GetD3D11ES3FormatInfo(GLint internalFormat, GLuint clientVersion, D3D11ES3FormatInfo *outFormatInfo)
{ {
static const D3D11ES3FormatMap formatMap = buildD3D11ES3FormatMap(); static const D3D11ES3FormatMap formatMap = BuildD3D11ES3FormatMap();
D3D11ES3FormatMap::const_iterator iter = formatMap.find(internalFormat); D3D11ES3FormatMap::const_iterator iter = formatMap.find(internalFormat);
if (iter != formatMap.end()) if (iter != formatMap.end())
{ {
...@@ -355,7 +355,7 @@ struct D3D11ES2FormatInfo ...@@ -355,7 +355,7 @@ struct D3D11ES2FormatInfo
typedef std::pair<GLint, D3D11ES2FormatInfo> D3D11ES2FormatPair; typedef std::pair<GLint, D3D11ES2FormatInfo> D3D11ES2FormatPair;
typedef std::map<GLint, D3D11ES2FormatInfo> D3D11ES2FormatMap; typedef std::map<GLint, D3D11ES2FormatInfo> D3D11ES2FormatMap;
static D3D11ES2FormatMap buildD3D11ES2FormatMap() static D3D11ES2FormatMap BuildD3D11ES2FormatMap()
{ {
D3D11ES2FormatMap map; D3D11ES2FormatMap map;
...@@ -399,9 +399,9 @@ static D3D11ES2FormatMap buildD3D11ES2FormatMap() ...@@ -399,9 +399,9 @@ static D3D11ES2FormatMap buildD3D11ES2FormatMap()
return map; return map;
} }
static bool getD3D11ES2FormatInfo(GLint internalFormat, GLuint clientVersion, D3D11ES2FormatInfo *outFormatInfo) static bool GetD3D11ES2FormatInfo(GLint internalFormat, GLuint clientVersion, D3D11ES2FormatInfo *outFormatInfo)
{ {
static const D3D11ES2FormatMap formatMap = buildD3D11ES2FormatMap(); static const D3D11ES2FormatMap formatMap = BuildD3D11ES2FormatMap();
D3D11ES2FormatMap::const_iterator iter = formatMap.find(internalFormat); D3D11ES2FormatMap::const_iterator iter = formatMap.find(internalFormat);
if (iter != formatMap.end()) if (iter != formatMap.end())
{ {
...@@ -441,7 +441,7 @@ struct DXGIFormatInfo ...@@ -441,7 +441,7 @@ struct DXGIFormatInfo
typedef std::pair<DXGI_FORMAT, DXGIFormatInfo> DXGIFormatInfoPair; typedef std::pair<DXGI_FORMAT, DXGIFormatInfo> DXGIFormatInfoPair;
typedef std::map<DXGI_FORMAT, DXGIFormatInfo> DXGIFormatInfoMap; typedef std::map<DXGI_FORMAT, DXGIFormatInfo> DXGIFormatInfoMap;
static DXGIFormatInfoMap buildDXGIFormatInfoMap() static DXGIFormatInfoMap BuildDXGIFormatInfoMap()
{ {
DXGIFormatInfoMap map; DXGIFormatInfoMap map;
...@@ -514,11 +514,11 @@ static DXGIFormatInfoMap buildDXGIFormatInfoMap() ...@@ -514,11 +514,11 @@ static DXGIFormatInfoMap buildDXGIFormatInfoMap()
static const DXGIFormatInfoMap &GetDXGIFormatInfoMap() static const DXGIFormatInfoMap &GetDXGIFormatInfoMap()
{ {
static const DXGIFormatInfoMap infoMap = buildDXGIFormatInfoMap(); static const DXGIFormatInfoMap infoMap = BuildDXGIFormatInfoMap();
return infoMap; return infoMap;
} }
static bool getDXGIFormatInfo(DXGI_FORMAT format, DXGIFormatInfo *outFormatInfo) static bool GetDXGIFormatInfo(DXGI_FORMAT format, DXGIFormatInfo *outFormatInfo)
{ {
const DXGIFormatInfoMap &infoMap = GetDXGIFormatInfoMap(); const DXGIFormatInfoMap &infoMap = GetDXGIFormatInfoMap();
DXGIFormatInfoMap::const_iterator iter = infoMap.find(format); DXGIFormatInfoMap::const_iterator iter = infoMap.find(format);
...@@ -555,7 +555,7 @@ namespace d3d11 ...@@ -555,7 +555,7 @@ namespace d3d11
MipGenerationFunction GetMipGenerationFunction(DXGI_FORMAT format) MipGenerationFunction GetMipGenerationFunction(DXGI_FORMAT format)
{ {
DXGIFormatInfo formatInfo; DXGIFormatInfo formatInfo;
if (getDXGIFormatInfo(format, &formatInfo)) if (GetDXGIFormatInfo(format, &formatInfo))
{ {
return formatInfo.mMipGenerationFunction; return formatInfo.mMipGenerationFunction;
} }
...@@ -571,7 +571,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint ...@@ -571,7 +571,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
if (clientVersion == 2) if (clientVersion == 2)
{ {
D3D11ES2FormatInfo d3d11FormatInfo; D3D11ES2FormatInfo d3d11FormatInfo;
if (getD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mLoadImageFunction; return d3d11FormatInfo.mLoadImageFunction;
} }
...@@ -605,7 +605,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint ...@@ -605,7 +605,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
GLuint GetFormatPixelBytes(DXGI_FORMAT format) GLuint GetFormatPixelBytes(DXGI_FORMAT format)
{ {
DXGIFormatInfo dxgiFormatInfo; DXGIFormatInfo dxgiFormatInfo;
if (getDXGIFormatInfo(format, &dxgiFormatInfo)) if (GetDXGIFormatInfo(format, &dxgiFormatInfo))
{ {
return dxgiFormatInfo.mPixelBits / 8; return dxgiFormatInfo.mPixelBits / 8;
} }
...@@ -619,7 +619,7 @@ GLuint GetFormatPixelBytes(DXGI_FORMAT format) ...@@ -619,7 +619,7 @@ GLuint GetFormatPixelBytes(DXGI_FORMAT format)
GLuint GetBlockWidth(DXGI_FORMAT format) GLuint GetBlockWidth(DXGI_FORMAT format)
{ {
DXGIFormatInfo dxgiFormatInfo; DXGIFormatInfo dxgiFormatInfo;
if (getDXGIFormatInfo(format, &dxgiFormatInfo)) if (GetDXGIFormatInfo(format, &dxgiFormatInfo))
{ {
return dxgiFormatInfo.mBlockWidth; return dxgiFormatInfo.mBlockWidth;
} }
...@@ -633,7 +633,7 @@ GLuint GetBlockWidth(DXGI_FORMAT format) ...@@ -633,7 +633,7 @@ GLuint GetBlockWidth(DXGI_FORMAT format)
GLuint GetBlockHeight(DXGI_FORMAT format) GLuint GetBlockHeight(DXGI_FORMAT format)
{ {
DXGIFormatInfo dxgiFormatInfo; DXGIFormatInfo dxgiFormatInfo;
if (getDXGIFormatInfo(format, &dxgiFormatInfo)) if (GetDXGIFormatInfo(format, &dxgiFormatInfo))
{ {
return dxgiFormatInfo.mBlockHeight; return dxgiFormatInfo.mBlockHeight;
} }
...@@ -647,7 +647,7 @@ GLuint GetBlockHeight(DXGI_FORMAT format) ...@@ -647,7 +647,7 @@ GLuint GetBlockHeight(DXGI_FORMAT format)
void MakeValidSize(bool isImage, DXGI_FORMAT format, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset) void MakeValidSize(bool isImage, DXGI_FORMAT format, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset)
{ {
DXGIFormatInfo dxgiFormatInfo; DXGIFormatInfo dxgiFormatInfo;
if (getDXGIFormatInfo(format, &dxgiFormatInfo)) if (GetDXGIFormatInfo(format, &dxgiFormatInfo))
{ {
int upsampleCount = 0; int upsampleCount = 0;
...@@ -688,7 +688,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion) ...@@ -688,7 +688,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion)
if (clientVersion == 2) if (clientVersion == 2)
{ {
D3D11ES2FormatInfo d3d11FormatInfo; D3D11ES2FormatInfo d3d11FormatInfo;
if (getD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mTexFormat; return d3d11FormatInfo.mTexFormat;
} }
...@@ -701,7 +701,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion) ...@@ -701,7 +701,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion)
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
D3D11ES3FormatInfo d3d11FormatInfo; D3D11ES3FormatInfo d3d11FormatInfo;
if (getD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mTexFormat; return d3d11FormatInfo.mTexFormat;
} }
...@@ -723,7 +723,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -723,7 +723,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion)
if (clientVersion == 2) if (clientVersion == 2)
{ {
D3D11ES2FormatInfo d3d11FormatInfo; D3D11ES2FormatInfo d3d11FormatInfo;
if (getD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mSRVFormat; return d3d11FormatInfo.mSRVFormat;
} }
...@@ -736,7 +736,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -736,7 +736,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion)
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
D3D11ES3FormatInfo d3d11FormatInfo; D3D11ES3FormatInfo d3d11FormatInfo;
if (getD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mSRVFormat; return d3d11FormatInfo.mSRVFormat;
} }
...@@ -758,7 +758,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -758,7 +758,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion)
if (clientVersion == 2) if (clientVersion == 2)
{ {
D3D11ES2FormatInfo d3d11FormatInfo; D3D11ES2FormatInfo d3d11FormatInfo;
if (getD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mRTVFormat; return d3d11FormatInfo.mRTVFormat;
} }
...@@ -771,7 +771,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -771,7 +771,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion)
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
D3D11ES3FormatInfo d3d11FormatInfo; D3D11ES3FormatInfo d3d11FormatInfo;
if (getD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mRTVFormat; return d3d11FormatInfo.mRTVFormat;
} }
...@@ -793,7 +793,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -793,7 +793,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion)
if (clientVersion == 2) if (clientVersion == 2)
{ {
D3D11ES2FormatInfo d3d11FormatInfo; D3D11ES2FormatInfo d3d11FormatInfo;
if (getD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mDSVFormat; return d3d11FormatInfo.mDSVFormat;
} }
...@@ -805,7 +805,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion) ...@@ -805,7 +805,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion)
else if (clientVersion == 3) else if (clientVersion == 3)
{ {
D3D11ES3FormatInfo d3d11FormatInfo; D3D11ES3FormatInfo d3d11FormatInfo;
if (getD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo)) if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
{ {
return d3d11FormatInfo.mDSVFormat; return d3d11FormatInfo.mDSVFormat;
} }
...@@ -829,7 +829,7 @@ namespace d3d11_gl ...@@ -829,7 +829,7 @@ namespace d3d11_gl
GLint GetInternalFormat(DXGI_FORMAT format) GLint GetInternalFormat(DXGI_FORMAT format)
{ {
DXGIFormatInfo formatInfo; DXGIFormatInfo formatInfo;
if (getDXGIFormatInfo(format, &formatInfo)) if (GetDXGIFormatInfo(format, &formatInfo))
{ {
return formatInfo.mInternalFormat; return formatInfo.mInternalFormat;
} }
......
...@@ -85,7 +85,7 @@ const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L'))); ...@@ -85,7 +85,7 @@ const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
typedef std::pair<GLint, D3D9FormatInfo> D3D9FormatPair; typedef std::pair<GLint, D3D9FormatInfo> D3D9FormatPair;
typedef std::map<GLint, D3D9FormatInfo> D3D9FormatMap; typedef std::map<GLint, D3D9FormatInfo> D3D9FormatMap;
static D3D9FormatMap buildD3D9FormatMap() static D3D9FormatMap BuildD3D9FormatMap()
{ {
D3D9FormatMap map; D3D9FormatMap map;
...@@ -134,9 +134,9 @@ static D3D9FormatMap buildD3D9FormatMap() ...@@ -134,9 +134,9 @@ static D3D9FormatMap buildD3D9FormatMap()
return map; return map;
} }
static bool getD3D9FormatInfo(GLint internalFormat, D3D9FormatInfo *outFormatInfo) static bool GetD3D9FormatInfo(GLint internalFormat, D3D9FormatInfo *outFormatInfo)
{ {
static const D3D9FormatMap formatMap = buildD3D9FormatMap(); static const D3D9FormatMap formatMap = BuildD3D9FormatMap();
D3D9FormatMap::const_iterator iter = formatMap.find(internalFormat); D3D9FormatMap::const_iterator iter = formatMap.find(internalFormat);
if (iter != formatMap.end()) if (iter != formatMap.end())
{ {
...@@ -176,7 +176,7 @@ struct D3DFormatInfo ...@@ -176,7 +176,7 @@ struct D3DFormatInfo
typedef std::pair<D3DFORMAT, D3DFormatInfo> D3D9FormatInfoPair; typedef std::pair<D3DFORMAT, D3DFormatInfo> D3D9FormatInfoPair;
typedef std::map<D3DFORMAT, D3DFormatInfo> D3D9FormatInfoMap; typedef std::map<D3DFORMAT, D3DFormatInfo> D3D9FormatInfoMap;
static D3D9FormatInfoMap buildD3D9FormatInfoMap() static D3D9FormatInfoMap BuildD3D9FormatInfoMap()
{ {
D3D9FormatInfoMap map; D3D9FormatInfoMap map;
...@@ -211,11 +211,11 @@ static D3D9FormatInfoMap buildD3D9FormatInfoMap() ...@@ -211,11 +211,11 @@ static D3D9FormatInfoMap buildD3D9FormatInfoMap()
static const D3D9FormatInfoMap &GetD3D9FormatInfoMap() static const D3D9FormatInfoMap &GetD3D9FormatInfoMap()
{ {
static const D3D9FormatInfoMap infoMap = buildD3D9FormatInfoMap(); static const D3D9FormatInfoMap infoMap = BuildD3D9FormatInfoMap();
return infoMap; return infoMap;
} }
static bool getD3D9FormatInfo(D3DFORMAT format, D3DFormatInfo *outFormatInfo) static bool GetD3D9FormatInfo(D3DFORMAT format, D3DFormatInfo *outFormatInfo)
{ {
const D3D9FormatInfoMap &infoMap = GetD3D9FormatInfoMap(); const D3D9FormatInfoMap &infoMap = GetD3D9FormatInfoMap();
D3D9FormatInfoMap::const_iterator iter = infoMap.find(format); D3D9FormatInfoMap::const_iterator iter = infoMap.find(format);
...@@ -251,7 +251,7 @@ namespace d3d9 ...@@ -251,7 +251,7 @@ namespace d3d9
MipGenerationFunction GetMipGenerationFunction(D3DFORMAT format) MipGenerationFunction GetMipGenerationFunction(D3DFORMAT format)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
return d3dFormatInfo.mMipGenerationFunction; return d3dFormatInfo.mMipGenerationFunction;
} }
...@@ -272,7 +272,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re ...@@ -272,7 +272,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re
ASSERT(renderer->getCurrentClientVersion() == 2); ASSERT(renderer->getCurrentClientVersion() == 2);
D3D9FormatInfo d3d9FormatInfo; D3D9FormatInfo d3d9FormatInfo;
if (getD3D9FormatInfo(internalFormat, &d3d9FormatInfo)) if (GetD3D9FormatInfo(internalFormat, &d3d9FormatInfo))
{ {
return d3d9FormatInfo.mLoadFunction(renderer); return d3d9FormatInfo.mLoadFunction(renderer);
} }
...@@ -286,7 +286,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re ...@@ -286,7 +286,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re
GLuint GetFormatPixelBytes(D3DFORMAT format) GLuint GetFormatPixelBytes(D3DFORMAT format)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
return d3dFormatInfo.mPixelBits / 8; return d3dFormatInfo.mPixelBits / 8;
} }
...@@ -300,7 +300,7 @@ GLuint GetFormatPixelBytes(D3DFORMAT format) ...@@ -300,7 +300,7 @@ GLuint GetFormatPixelBytes(D3DFORMAT format)
GLuint GetBlockWidth(D3DFORMAT format) GLuint GetBlockWidth(D3DFORMAT format)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
return d3dFormatInfo.mBlockWidth; return d3dFormatInfo.mBlockWidth;
} }
...@@ -314,7 +314,7 @@ GLuint GetBlockWidth(D3DFORMAT format) ...@@ -314,7 +314,7 @@ GLuint GetBlockWidth(D3DFORMAT format)
GLuint GetBlockHeight(D3DFORMAT format) GLuint GetBlockHeight(D3DFORMAT format)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
return d3dFormatInfo.mBlockHeight; return d3dFormatInfo.mBlockHeight;
} }
...@@ -328,7 +328,7 @@ GLuint GetBlockHeight(D3DFORMAT format) ...@@ -328,7 +328,7 @@ GLuint GetBlockHeight(D3DFORMAT format)
GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height) GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
GLuint numBlocksWide = (width + d3dFormatInfo.mBlockWidth - 1) / d3dFormatInfo.mBlockWidth; GLuint numBlocksWide = (width + d3dFormatInfo.mBlockWidth - 1) / d3dFormatInfo.mBlockWidth;
GLuint numBlocksHight = (height + d3dFormatInfo.mBlockHeight - 1) / d3dFormatInfo.mBlockHeight; GLuint numBlocksHight = (height + d3dFormatInfo.mBlockHeight - 1) / d3dFormatInfo.mBlockHeight;
...@@ -345,7 +345,7 @@ GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height) ...@@ -345,7 +345,7 @@ GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height)
void MakeValidSize(bool isImage, D3DFORMAT format, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset) void MakeValidSize(bool isImage, D3DFORMAT format, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset)
{ {
D3DFormatInfo d3dFormatInfo; D3DFormatInfo d3dFormatInfo;
if (getD3D9FormatInfo(format, &d3dFormatInfo)) if (GetD3D9FormatInfo(format, &d3dFormatInfo))
{ {
int upsampleCount = 0; int upsampleCount = 0;
...@@ -388,7 +388,7 @@ D3DFORMAT GetTexureFormat(GLint internalFormat, const Renderer9 *renderer) ...@@ -388,7 +388,7 @@ D3DFORMAT GetTexureFormat(GLint internalFormat, const Renderer9 *renderer)
ASSERT(renderer->getCurrentClientVersion() == 2); ASSERT(renderer->getCurrentClientVersion() == 2);
D3D9FormatInfo d3d9FormatInfo; D3D9FormatInfo d3d9FormatInfo;
if (getD3D9FormatInfo(internalFormat, &d3d9FormatInfo)) if (GetD3D9FormatInfo(internalFormat, &d3d9FormatInfo))
{ {
return d3d9FormatInfo.mTexFormat(renderer); return d3d9FormatInfo.mTexFormat(renderer);
} }
...@@ -410,7 +410,7 @@ D3DFORMAT GetRenderFormat(GLint internalFormat, const Renderer9 *renderer) ...@@ -410,7 +410,7 @@ D3DFORMAT GetRenderFormat(GLint internalFormat, const Renderer9 *renderer)
ASSERT(renderer->getCurrentClientVersion() == 2); ASSERT(renderer->getCurrentClientVersion() == 2);
D3D9FormatInfo d3d9FormatInfo; D3D9FormatInfo d3d9FormatInfo;
if (getD3D9FormatInfo(internalFormat, &d3d9FormatInfo)) if (GetD3D9FormatInfo(internalFormat, &d3d9FormatInfo))
{ {
return d3d9FormatInfo.mRenderFormat(renderer); return d3d9FormatInfo.mRenderFormat(renderer);
} }
...@@ -433,7 +433,7 @@ namespace d3d9_gl ...@@ -433,7 +433,7 @@ namespace d3d9_gl
GLint GetInternalFormat(D3DFORMAT format) GLint GetInternalFormat(D3DFORMAT format)
{ {
static const D3D9FormatInfoMap infoMap = buildD3D9FormatInfoMap(); static const D3D9FormatInfoMap infoMap = BuildD3D9FormatInfoMap();
D3D9FormatInfoMap::const_iterator iter = infoMap.find(format); D3D9FormatInfoMap::const_iterator iter = infoMap.find(format);
if (iter != infoMap.end()) if (iter != infoMap.end())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment