Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
18591b7c
Commit
18591b7c
authored
Jun 07, 2013
by
Geoff Lang
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capitalized the first letter of all private format util functions.
TRAC #23212 Signed-off-by: Shannon Woods Author: Geoff Lang
parent
2e1dcd59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
166 additions
and
166 deletions
+166
-166
formatutils.cpp
src/libGLESv2/formatutils.cpp
+126
-126
formatutils11.cpp
src/libGLESv2/renderer/formatutils11.cpp
+24
-24
formatutils9.cpp
src/libGLESv2/renderer/formatutils9.cpp
+16
-16
No files found.
src/libGLESv2/formatutils.cpp
View file @
18591b7c
...
...
@@ -24,98 +24,98 @@ typedef std::pair<FormatTypePair, GLint> FormatPair;
typedef
std
::
map
<
FormatTypePair
,
GLint
>
FormatMap
;
// A helper function to insert data into the D3D11LoadFunctionMap with fewer characters.
static
inline
void
i
nsertFormatMapping
(
FormatMap
*
map
,
GLenum
format
,
GLenum
type
,
GLint
internalFormat
)
static
inline
void
I
nsertFormatMapping
(
FormatMap
*
map
,
GLenum
format
,
GLenum
type
,
GLint
internalFormat
)
{
map
->
insert
(
FormatPair
(
FormatTypePair
(
format
,
type
),
internalFormat
));
}
FormatMap
b
uildES2FormatMap
()
FormatMap
B
uildES2FormatMap
()
{
FormatMap
map
;
// | Format | Type | Internal format |
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_ALPHA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_FLOAT
,
GL_ALPHA32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_HALF_FLOAT_OES
,
GL_ALPHA16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_ALPHA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_FLOAT
,
GL_ALPHA32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_HALF_FLOAT_OES
,
GL_ALPHA16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_FLOAT
,
GL_LUMINANCE32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_HALF_FLOAT_OES
,
GL_LUMINANCE16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_FLOAT
,
GL_LUMINANCE32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_HALF_FLOAT_OES
,
GL_LUMINANCE16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_ALPHA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_FLOAT
,
GL_LUMINANCE_ALPHA32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_HALF_FLOAT_OES
,
GL_LUMINANCE_ALPHA16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_ALPHA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_FLOAT
,
GL_LUMINANCE_ALPHA32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_HALF_FLOAT_OES
,
GL_LUMINANCE_ALPHA16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
GL_RGB8_OES
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
GL_RGB565
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_FLOAT
,
GL_RGB32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_HALF_FLOAT_OES
,
GL_RGB16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
GL_RGB8_OES
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
GL_RGB565
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_FLOAT
,
GL_RGB32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_HALF_FLOAT_OES
,
GL_RGB16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
GL_RGBA8_OES
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_4_4_4_4
,
GL_RGBA4
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_5_5_5_1
,
GL_RGB5_A1
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_FLOAT
,
GL_RGBA32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_HALF_FLOAT_OES
,
GL_RGBA16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
GL_RGBA8_OES
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_4_4_4_4
,
GL_RGBA4
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_5_5_5_1
,
GL_RGB5_A1
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_FLOAT
,
GL_RGBA32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_HALF_FLOAT_OES
,
GL_RGBA16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_BYTE
,
GL_BGRA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT
,
GL_BGRA4_ANGLEX
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT
,
GL_BGR5_A1_ANGLEX
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_BYTE
,
GL_BGRA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT
,
GL_BGRA4_ANGLEX
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT
,
GL_BGR5_A1_ANGLEX
);
i
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
);
i
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
);
I
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
);
I
nsertFormatMapping
(
&
map
,
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
,
GL_UNSIGNED_BYTE
,
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_SHORT
,
GL_DEPTH_COMPONENT16
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_INT
,
GL_DEPTH_COMPONENT32_OES
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_SHORT
,
GL_DEPTH_COMPONENT16
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_INT
,
GL_DEPTH_COMPONENT32_OES
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL_OES
,
GL_UNSIGNED_INT_24_8_OES
,
GL_DEPTH24_STENCIL8_OES
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL_OES
,
GL_UNSIGNED_INT_24_8_OES
,
GL_DEPTH24_STENCIL8_OES
);
return
map
;
}
static
const
FormatMap
&
g
etES2FormatMap
()
static
const
FormatMap
&
G
etES2FormatMap
()
{
static
const
FormatMap
es2FormatMap
=
b
uildES2FormatMap
();
static
const
FormatMap
es2FormatMap
=
B
uildES2FormatMap
();
return
es2FormatMap
;
}
FormatMap
b
uildES3FormatMap
()
FormatMap
B
uildES3FormatMap
()
{
FormatMap
map
;
// | Format | Type | Internal format |
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
GL_RGBA8
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_4_4_4_4
,
GL_RGBA4
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_5_5_5_1
,
GL_RGB5_A1
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_FLOAT
,
GL_RGBA32F
);
i
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_HALF_FLOAT
,
GL_RGBA16F
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
GL_RGB8
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
GL_RGB565
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_FLOAT
,
GL_RGB32F
);
i
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_HALF_FLOAT
,
GL_RGB16F
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_ALPHA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_ALPHA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_FLOAT
,
GL_LUMINANCE_ALPHA32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_FLOAT
,
GL_LUMINANCE32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_FLOAT
,
GL_ALPHA32F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_HALF_FLOAT
,
GL_LUMINANCE_ALPHA16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_HALF_FLOAT
,
GL_LUMINANCE16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_HALF_FLOAT
,
GL_ALPHA16F_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_BYTE
,
GL_BGRA8_EXT
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT
,
GL_BGRA4_ANGLEX
);
i
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT
,
GL_BGR5_A1_ANGLEX
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_SHORT
,
GL_DEPTH_COMPONENT16
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_INT
,
GL_DEPTH_COMPONENT24
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
GL_DEPTH_COMPONENT32F
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL
,
GL_UNSIGNED_INT_24_8
,
GL_DEPTH24_STENCIL8
);
i
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
GL_DEPTH32F_STENCIL8
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
GL_RGBA8
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_4_4_4_4
,
GL_RGBA4
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_UNSIGNED_SHORT_5_5_5_1
,
GL_RGB5_A1
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_FLOAT
,
GL_RGBA32F
);
I
nsertFormatMapping
(
&
map
,
GL_RGBA
,
GL_HALF_FLOAT
,
GL_RGBA16F
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
GL_RGB8
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
GL_RGB565
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_FLOAT
,
GL_RGB32F
);
I
nsertFormatMapping
(
&
map
,
GL_RGB
,
GL_HALF_FLOAT
,
GL_RGB16F
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_ALPHA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
GL_LUMINANCE8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
GL_ALPHA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_FLOAT
,
GL_LUMINANCE_ALPHA32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_FLOAT
,
GL_LUMINANCE32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_FLOAT
,
GL_ALPHA32F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE_ALPHA
,
GL_HALF_FLOAT
,
GL_LUMINANCE_ALPHA16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_LUMINANCE
,
GL_HALF_FLOAT
,
GL_LUMINANCE16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_ALPHA
,
GL_HALF_FLOAT
,
GL_ALPHA16F_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_BYTE
,
GL_BGRA8_EXT
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT
,
GL_BGRA4_ANGLEX
);
I
nsertFormatMapping
(
&
map
,
GL_BGRA_EXT
,
GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT
,
GL_BGR5_A1_ANGLEX
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_SHORT
,
GL_DEPTH_COMPONENT16
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_INT
,
GL_DEPTH_COMPONENT24
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
GL_DEPTH_COMPONENT32F
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL
,
GL_UNSIGNED_INT_24_8
,
GL_DEPTH24_STENCIL8
);
I
nsertFormatMapping
(
&
map
,
GL_DEPTH_STENCIL
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
GL_DEPTH32F_STENCIL8
);
return
map
;
}
...
...
@@ -138,7 +138,7 @@ struct FormatInfo
// ES3 has a specific set of permutations of internal formats, formats and types which are acceptable.
typedef
std
::
set
<
FormatInfo
>
ES3FormatSet
;
ES3FormatSet
b
uildES3FormatSet
()
ES3FormatSet
B
uildES3FormatSet
()
{
ES3FormatSet
set
;
...
...
@@ -288,9 +288,9 @@ ES3FormatSet buildES3FormatSet()
return
set
;
}
static
const
ES3FormatSet
&
g
etES3FormatSet
()
static
const
ES3FormatSet
&
G
etES3FormatSet
()
{
static
const
ES3FormatSet
es3FormatSet
=
b
uildES3FormatSet
();
static
const
ES3FormatSet
es3FormatSet
=
B
uildES3FormatSet
();
return
es3FormatSet
;
}
...
...
@@ -315,7 +315,7 @@ struct TypeInfo
typedef
std
::
pair
<
GLenum
,
TypeInfo
>
TypeInfoPair
;
typedef
std
::
map
<
GLenum
,
TypeInfo
>
TypeInfoMap
;
static
TypeInfoMap
b
uildTypeInfoMap
()
static
TypeInfoMap
B
uildTypeInfoMap
()
{
TypeInfoMap
map
;
...
...
@@ -342,9 +342,9 @@ static TypeInfoMap buildTypeInfoMap()
return
map
;
}
static
bool
g
etTypeInfo
(
GLenum
type
,
TypeInfo
*
outTypeInfo
)
static
bool
G
etTypeInfo
(
GLenum
type
,
TypeInfo
*
outTypeInfo
)
{
static
const
TypeInfoMap
infoMap
=
b
uildTypeInfoMap
();
static
const
TypeInfoMap
infoMap
=
B
uildTypeInfoMap
();
TypeInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
type
);
if
(
iter
!=
infoMap
.
end
())
{
...
...
@@ -571,7 +571,7 @@ struct InternalFormatInfo
typedef
std
::
pair
<
GLuint
,
InternalFormatInfo
>
InternalFormatInfoPair
;
typedef
std
::
map
<
GLuint
,
InternalFormatInfo
>
InternalFormatInfoMap
;
static
InternalFormatInfoMap
b
uildES3InternalFormatInfoMap
()
static
InternalFormatInfoMap
B
uildES3InternalFormatInfoMap
()
{
InternalFormatInfoMap
map
;
...
...
@@ -699,7 +699,7 @@ static InternalFormatInfoMap buildES3InternalFormatInfoMap()
return
map
;
}
static
InternalFormatInfoMap
b
uildES2InternalFormatInfoMap
()
static
InternalFormatInfoMap
B
uildES2InternalFormatInfoMap
()
{
InternalFormatInfoMap
map
;
...
...
@@ -775,18 +775,18 @@ static InternalFormatInfoMap buildES2InternalFormatInfoMap()
return
map
;
}
static
bool
g
etInternalFormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
InternalFormatInfo
*
outFormatInfo
)
static
bool
G
etInternalFormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
InternalFormatInfo
*
outFormatInfo
)
{
const
InternalFormatInfoMap
*
map
=
NULL
;
if
(
clientVersion
==
2
)
{
static
const
InternalFormatInfoMap
formatMap
=
b
uildES2InternalFormatInfoMap
();
static
const
InternalFormatInfoMap
formatMap
=
B
uildES2InternalFormatInfoMap
();
map
=
&
formatMap
;
}
else
if
(
clientVersion
==
3
)
{
static
const
InternalFormatInfoMap
formatMap
=
b
uildES3InternalFormatInfoMap
();
static
const
InternalFormatInfoMap
formatMap
=
B
uildES3InternalFormatInfoMap
();
map
=
&
formatMap
;
}
else
...
...
@@ -811,9 +811,9 @@ static bool getInternalFormatInfo(GLint internalFormat, GLuint clientVersion, In
typedef
std
::
set
<
GLenum
>
FormatSet
;
static
FormatSet
b
uildES2ValidFormatSet
()
static
FormatSet
B
uildES2ValidFormatSet
()
{
static
const
FormatMap
&
formatMap
=
g
etES2FormatMap
();
static
const
FormatMap
&
formatMap
=
G
etES2FormatMap
();
FormatSet
set
;
...
...
@@ -826,9 +826,9 @@ static FormatSet buildES2ValidFormatSet()
return
set
;
}
static
FormatSet
b
uildES3ValidFormatSet
()
static
FormatSet
B
uildES3ValidFormatSet
()
{
static
const
ES3FormatSet
&
formatSet
=
g
etES3FormatSet
();
static
const
ES3FormatSet
&
formatSet
=
G
etES3FormatSet
();
FormatSet
set
;
...
...
@@ -843,9 +843,9 @@ static FormatSet buildES3ValidFormatSet()
typedef
std
::
set
<
GLenum
>
TypeSet
;
static
TypeSet
b
uildES2ValidTypeSet
()
static
TypeSet
B
uildES2ValidTypeSet
()
{
static
const
FormatMap
&
formatMap
=
g
etES2FormatMap
();
static
const
FormatMap
&
formatMap
=
G
etES2FormatMap
();
TypeSet
set
;
...
...
@@ -858,9 +858,9 @@ static TypeSet buildES2ValidTypeSet()
return
set
;
}
static
TypeSet
b
uildES3ValidTypeSet
()
static
TypeSet
B
uildES3ValidTypeSet
()
{
static
const
ES3FormatSet
&
formatSet
=
g
etES3FormatSet
();
static
const
ES3FormatSet
&
formatSet
=
G
etES3FormatSet
();
TypeSet
set
;
...
...
@@ -889,7 +889,7 @@ struct CopyConversion
typedef
std
::
set
<
CopyConversion
>
CopyConversionSet
;
static
CopyConversionSet
b
uildValidES3CopyTexImageCombinations
()
static
CopyConversionSet
B
uildValidES3CopyTexImageCombinations
()
{
CopyConversionSet
set
;
...
...
@@ -933,7 +933,7 @@ bool IsValidInternalFormat(GLint internalFormat, const Context *context)
}
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
{
ASSERT
(
internalFormatInfo
.
mSupportFunction
!=
NULL
);
return
internalFormatInfo
.
mSupportFunction
(
context
);
...
...
@@ -948,12 +948,12 @@ bool IsValidFormat(GLenum format, GLuint clientVersion)
{
if
(
clientVersion
==
2
)
{
static
const
FormatSet
formatSet
=
b
uildES2ValidFormatSet
();
static
const
FormatSet
formatSet
=
B
uildES2ValidFormatSet
();
return
formatSet
.
find
(
format
)
!=
formatSet
.
end
();
}
else
if
(
clientVersion
==
3
)
{
static
const
FormatSet
formatSet
=
b
uildES3ValidFormatSet
();
static
const
FormatSet
formatSet
=
B
uildES3ValidFormatSet
();
return
formatSet
.
find
(
format
)
!=
formatSet
.
end
();
}
else
...
...
@@ -967,12 +967,12 @@ bool IsValidType(GLenum type, GLuint clientVersion)
{
if
(
clientVersion
==
2
)
{
static
const
TypeSet
typeSet
=
b
uildES2ValidTypeSet
();
static
const
TypeSet
typeSet
=
B
uildES2ValidTypeSet
();
return
typeSet
.
find
(
type
)
!=
typeSet
.
end
();
}
else
if
(
clientVersion
==
3
)
{
static
const
TypeSet
typeSet
=
b
uildES3ValidTypeSet
();
static
const
TypeSet
typeSet
=
B
uildES3ValidTypeSet
();
return
typeSet
.
find
(
type
)
!=
typeSet
.
end
();
}
else
...
...
@@ -986,14 +986,14 @@ bool IsValidFormatCombination(GLint internalFormat, GLenum format, GLenum type,
{
if
(
clientVersion
==
2
)
{
static
const
FormatMap
&
formats
=
g
etES2FormatMap
();
static
const
FormatMap
&
formats
=
G
etES2FormatMap
();
FormatMap
::
const_iterator
iter
=
formats
.
find
(
FormatTypePair
(
format
,
type
));
return
(
iter
!=
formats
.
end
())
&&
((
internalFormat
==
(
GLint
)
type
)
||
(
internalFormat
==
iter
->
second
));
}
else
if
(
clientVersion
==
3
)
{
static
const
ES3FormatSet
&
formats
=
g
etES3FormatSet
();
static
const
ES3FormatSet
&
formats
=
G
etES3FormatSet
();
return
formats
.
find
(
FormatInfo
(
internalFormat
,
format
,
type
))
!=
formats
.
end
();
}
else
...
...
@@ -1007,8 +1007,8 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
{
InternalFormatInfo
textureInternalFormatInfo
;
InternalFormatInfo
framebufferInternalFormatInfo
;
if
(
g
etInternalFormatInfo
(
textureInternalFormat
,
clientVersion
,
&
textureInternalFormatInfo
)
&&
g
etInternalFormatInfo
(
frameBufferInternalFormat
,
clientVersion
,
&
framebufferInternalFormatInfo
))
if
(
G
etInternalFormatInfo
(
textureInternalFormat
,
clientVersion
,
&
textureInternalFormatInfo
)
&&
G
etInternalFormatInfo
(
frameBufferInternalFormat
,
clientVersion
,
&
framebufferInternalFormatInfo
))
{
if
(
clientVersion
==
2
)
{
...
...
@@ -1017,7 +1017,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
}
else
if
(
clientVersion
==
3
)
{
static
const
CopyConversionSet
conversionSet
=
b
uildValidES3CopyTexImageCombinations
();
static
const
CopyConversionSet
conversionSet
=
B
uildValidES3CopyTexImageCombinations
();
const
CopyConversion
conversion
=
CopyConversion
(
textureInternalFormatInfo
.
mFormat
,
framebufferInternalFormatInfo
.
mFormat
);
if
(
conversionSet
.
find
(
conversion
)
!=
conversionSet
.
end
())
...
...
@@ -1062,7 +1062,7 @@ bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBu
bool
IsSizedInternalFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mPixelBits
>
0
;
}
...
...
@@ -1077,13 +1077,13 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion)
{
if
(
clientVersion
==
2
)
{
static
const
FormatMap
&
formats
=
g
etES2FormatMap
();
static
const
FormatMap
&
formats
=
G
etES2FormatMap
();
FormatMap
::
const_iterator
iter
=
formats
.
find
(
FormatTypePair
(
format
,
type
));
return
(
iter
!=
formats
.
end
())
?
iter
->
second
:
GL_NONE
;
}
else
if
(
clientVersion
==
3
)
{
static
const
FormatMap
formats
=
b
uildES3FormatMap
();
static
const
FormatMap
formats
=
B
uildES3FormatMap
();
FormatMap
::
const_iterator
iter
=
formats
.
find
(
FormatTypePair
(
format
,
type
));
return
(
iter
!=
formats
.
end
())
?
iter
->
second
:
GL_NONE
;
}
...
...
@@ -1097,7 +1097,7 @@ GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion)
GLuint
GetPixelBytes
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mPixelBits
/
8
;
}
...
...
@@ -1111,7 +1111,7 @@ GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion)
GLuint
GetAlphaBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mAlphaBits
;
}
...
...
@@ -1125,7 +1125,7 @@ GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetRedBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mRedBits
;
}
...
...
@@ -1139,7 +1139,7 @@ GLuint GetRedBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetGreenBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mGreenBits
;
}
...
...
@@ -1153,7 +1153,7 @@ GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetBlueBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mGreenBits
;
}
...
...
@@ -1167,7 +1167,7 @@ GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetLuminanceBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mLuminanceBits
;
}
...
...
@@ -1181,7 +1181,7 @@ GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetDepthBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mDepthBits
;
}
...
...
@@ -1195,7 +1195,7 @@ GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion)
GLuint
GetStencilBits
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStencilBits
;
}
...
...
@@ -1209,7 +1209,7 @@ GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion)
GLenum
GetFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mFormat
;
}
...
...
@@ -1223,7 +1223,7 @@ GLenum GetFormat(GLint internalFormat, GLuint clientVersion)
GLenum
GetType
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mType
;
}
...
...
@@ -1237,7 +1237,7 @@ GLenum GetType(GLint internalFormat, GLuint clientVersion)
bool
IsNormalizedFixedPointFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
NormalizedFixedPoint
;
}
...
...
@@ -1251,7 +1251,7 @@ bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion)
bool
IsIntegerFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
UnsignedInteger
||
internalFormatInfo
.
mStorageType
==
SignedInteger
;
...
...
@@ -1266,7 +1266,7 @@ bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool
IsSignedIntegerFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
SignedInteger
;
}
...
...
@@ -1280,7 +1280,7 @@ bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool
IsUnsignedIntegerFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
UnsignedInteger
;
}
...
...
@@ -1294,7 +1294,7 @@ bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion)
bool
IsFloatingPointFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
FloatingPoint
;
}
...
...
@@ -1308,7 +1308,7 @@ bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion)
bool
IsSRGBFormat
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsSRGB
;
}
...
...
@@ -1322,7 +1322,7 @@ bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion)
bool
IsColorRenderingSupported
(
GLint
internalFormat
,
const
rx
::
Renderer
*
renderer
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
renderer
&&
g
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
if
(
renderer
&&
G
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsColorRenderable
(
NULL
,
renderer
);
}
...
...
@@ -1336,7 +1336,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *rendere
bool
IsColorRenderingSupported
(
GLint
internalFormat
,
const
Context
*
context
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
context
&&
g
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
if
(
context
&&
G
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsColorRenderable
(
context
,
NULL
);
}
...
...
@@ -1350,7 +1350,7 @@ bool IsColorRenderingSupported(GLint internalFormat, const Context *context)
bool
IsTextureFilteringSupported
(
GLint
internalFormat
,
const
rx
::
Renderer
*
renderer
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
renderer
&&
g
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
if
(
renderer
&&
G
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsTextureFilterable
(
NULL
,
renderer
);
}
...
...
@@ -1364,7 +1364,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *rende
bool
IsTextureFilteringSupported
(
GLint
internalFormat
,
const
Context
*
context
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
context
&&
g
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
if
(
context
&&
G
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsTextureFilterable
(
context
,
NULL
);
}
...
...
@@ -1378,7 +1378,7 @@ bool IsTextureFilteringSupported(GLint internalFormat, const Context *context)
bool
IsDepthRenderingSupported
(
GLint
internalFormat
,
const
rx
::
Renderer
*
renderer
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
renderer
&&
g
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
if
(
renderer
&&
G
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsDepthRenderable
(
NULL
,
renderer
);
}
...
...
@@ -1392,7 +1392,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *rendere
bool
IsDepthRenderingSupported
(
GLint
internalFormat
,
const
Context
*
context
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
context
&&
g
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
if
(
context
&&
G
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsDepthRenderable
(
context
,
NULL
);
}
...
...
@@ -1406,7 +1406,7 @@ bool IsDepthRenderingSupported(GLint internalFormat, const Context *context)
bool
IsStencilRenderingSupported
(
GLint
internalFormat
,
const
rx
::
Renderer
*
renderer
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
renderer
&&
g
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
if
(
renderer
&&
G
etInternalFormatInfo
(
internalFormat
,
renderer
->
getCurrentClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsStencilRenderable
(
NULL
,
renderer
);
}
...
...
@@ -1420,7 +1420,7 @@ bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *rende
bool
IsStencilRenderingSupported
(
GLint
internalFormat
,
const
Context
*
context
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
context
&&
g
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
if
(
context
&&
G
etInternalFormatInfo
(
internalFormat
,
context
->
getClientVersion
(),
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mIsStencilRenderable
(
context
,
NULL
);
}
...
...
@@ -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
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
if
(
internalFormatInfo
.
mStorageType
==
Compressed
)
{
...
...
@@ -1457,7 +1457,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs
else
{
TypeInfo
typeInfo
;
if
(
g
etTypeInfo
(
type
,
&
typeInfo
))
if
(
G
etTypeInfo
(
type
,
&
typeInfo
))
{
if
(
typeInfo
.
mSpecialInterpretation
)
{
...
...
@@ -1485,7 +1485,7 @@ GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLs
bool
IsFormatCompressed
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mStorageType
==
Compressed
;
}
...
...
@@ -1499,7 +1499,7 @@ bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion)
GLuint
GetCompressedBlockWidth
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mCompressedBlockWidth
;
}
...
...
@@ -1513,7 +1513,7 @@ GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion)
GLuint
GetCompressedBlockHeight
(
GLint
internalFormat
,
GLuint
clientVersion
)
{
InternalFormatInfo
internalFormatInfo
;
if
(
g
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
if
(
G
etInternalFormatInfo
(
internalFormat
,
clientVersion
,
&
internalFormatInfo
))
{
return
internalFormatInfo
.
mCompressedBlockHeight
;
}
...
...
src/libGLESv2/renderer/formatutils11.cpp
View file @
18591b7c
...
...
@@ -37,7 +37,7 @@ struct D3D11ES3FormatInfo
typedef
std
::
pair
<
GLint
,
D3D11ES3FormatInfo
>
D3D11ES3FormatPair
;
typedef
std
::
map
<
GLint
,
D3D11ES3FormatInfo
>
D3D11ES3FormatMap
;
static
D3D11ES3FormatMap
b
uildD3D11ES3FormatMap
()
static
D3D11ES3FormatMap
B
uildD3D11ES3FormatMap
()
{
D3D11ES3FormatMap
map
;
...
...
@@ -152,9 +152,9 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
return
map
;
}
static
bool
g
etD3D11ES3FormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
D3D11ES3FormatInfo
*
outFormatInfo
)
static
bool
G
etD3D11ES3FormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
D3D11ES3FormatInfo
*
outFormatInfo
)
{
static
const
D3D11ES3FormatMap
formatMap
=
b
uildD3D11ES3FormatMap
();
static
const
D3D11ES3FormatMap
formatMap
=
B
uildD3D11ES3FormatMap
();
D3D11ES3FormatMap
::
const_iterator
iter
=
formatMap
.
find
(
internalFormat
);
if
(
iter
!=
formatMap
.
end
())
{
...
...
@@ -355,7 +355,7 @@ struct D3D11ES2FormatInfo
typedef
std
::
pair
<
GLint
,
D3D11ES2FormatInfo
>
D3D11ES2FormatPair
;
typedef
std
::
map
<
GLint
,
D3D11ES2FormatInfo
>
D3D11ES2FormatMap
;
static
D3D11ES2FormatMap
b
uildD3D11ES2FormatMap
()
static
D3D11ES2FormatMap
B
uildD3D11ES2FormatMap
()
{
D3D11ES2FormatMap
map
;
...
...
@@ -399,9 +399,9 @@ static D3D11ES2FormatMap buildD3D11ES2FormatMap()
return
map
;
}
static
bool
g
etD3D11ES2FormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
D3D11ES2FormatInfo
*
outFormatInfo
)
static
bool
G
etD3D11ES2FormatInfo
(
GLint
internalFormat
,
GLuint
clientVersion
,
D3D11ES2FormatInfo
*
outFormatInfo
)
{
static
const
D3D11ES2FormatMap
formatMap
=
b
uildD3D11ES2FormatMap
();
static
const
D3D11ES2FormatMap
formatMap
=
B
uildD3D11ES2FormatMap
();
D3D11ES2FormatMap
::
const_iterator
iter
=
formatMap
.
find
(
internalFormat
);
if
(
iter
!=
formatMap
.
end
())
{
...
...
@@ -441,7 +441,7 @@ struct DXGIFormatInfo
typedef
std
::
pair
<
DXGI_FORMAT
,
DXGIFormatInfo
>
DXGIFormatInfoPair
;
typedef
std
::
map
<
DXGI_FORMAT
,
DXGIFormatInfo
>
DXGIFormatInfoMap
;
static
DXGIFormatInfoMap
b
uildDXGIFormatInfoMap
()
static
DXGIFormatInfoMap
B
uildDXGIFormatInfoMap
()
{
DXGIFormatInfoMap
map
;
...
...
@@ -514,11 +514,11 @@ static DXGIFormatInfoMap buildDXGIFormatInfoMap()
static
const
DXGIFormatInfoMap
&
GetDXGIFormatInfoMap
()
{
static
const
DXGIFormatInfoMap
infoMap
=
b
uildDXGIFormatInfoMap
();
static
const
DXGIFormatInfoMap
infoMap
=
B
uildDXGIFormatInfoMap
();
return
infoMap
;
}
static
bool
g
etDXGIFormatInfo
(
DXGI_FORMAT
format
,
DXGIFormatInfo
*
outFormatInfo
)
static
bool
G
etDXGIFormatInfo
(
DXGI_FORMAT
format
,
DXGIFormatInfo
*
outFormatInfo
)
{
const
DXGIFormatInfoMap
&
infoMap
=
GetDXGIFormatInfoMap
();
DXGIFormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
...
...
@@ -555,7 +555,7 @@ namespace d3d11
MipGenerationFunction
GetMipGenerationFunction
(
DXGI_FORMAT
format
)
{
DXGIFormatInfo
formatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
formatInfo
))
{
return
formatInfo
.
mMipGenerationFunction
;
}
...
...
@@ -571,7 +571,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
if
(
clientVersion
==
2
)
{
D3D11ES2FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mLoadImageFunction
;
}
...
...
@@ -605,7 +605,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
GLuint
GetFormatPixelBytes
(
DXGI_FORMAT
format
)
{
DXGIFormatInfo
dxgiFormatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
{
return
dxgiFormatInfo
.
mPixelBits
/
8
;
}
...
...
@@ -619,7 +619,7 @@ GLuint GetFormatPixelBytes(DXGI_FORMAT format)
GLuint
GetBlockWidth
(
DXGI_FORMAT
format
)
{
DXGIFormatInfo
dxgiFormatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
{
return
dxgiFormatInfo
.
mBlockWidth
;
}
...
...
@@ -633,7 +633,7 @@ GLuint GetBlockWidth(DXGI_FORMAT format)
GLuint
GetBlockHeight
(
DXGI_FORMAT
format
)
{
DXGIFormatInfo
dxgiFormatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
{
return
dxgiFormatInfo
.
mBlockHeight
;
}
...
...
@@ -647,7 +647,7 @@ GLuint GetBlockHeight(DXGI_FORMAT format)
void
MakeValidSize
(
bool
isImage
,
DXGI_FORMAT
format
,
GLsizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
)
{
DXGIFormatInfo
dxgiFormatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
{
int
upsampleCount
=
0
;
...
...
@@ -688,7 +688,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion)
if
(
clientVersion
==
2
)
{
D3D11ES2FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mTexFormat
;
}
...
...
@@ -701,7 +701,7 @@ DXGI_FORMAT GetTexFormat(GLint internalFormat, GLuint clientVersion)
else
if
(
clientVersion
==
3
)
{
D3D11ES3FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mTexFormat
;
}
...
...
@@ -723,7 +723,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion)
if
(
clientVersion
==
2
)
{
D3D11ES2FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mSRVFormat
;
}
...
...
@@ -736,7 +736,7 @@ DXGI_FORMAT GetSRVFormat(GLint internalFormat, GLuint clientVersion)
else
if
(
clientVersion
==
3
)
{
D3D11ES3FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mSRVFormat
;
}
...
...
@@ -758,7 +758,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion)
if
(
clientVersion
==
2
)
{
D3D11ES2FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mRTVFormat
;
}
...
...
@@ -771,7 +771,7 @@ DXGI_FORMAT GetRTVFormat(GLint internalFormat, GLuint clientVersion)
else
if
(
clientVersion
==
3
)
{
D3D11ES3FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mRTVFormat
;
}
...
...
@@ -793,7 +793,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion)
if
(
clientVersion
==
2
)
{
D3D11ES2FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mDSVFormat
;
}
...
...
@@ -805,7 +805,7 @@ DXGI_FORMAT GetDSVFormat(GLint internalFormat, GLuint clientVersion)
else
if
(
clientVersion
==
3
)
{
D3D11ES3FormatInfo
d3d11FormatInfo
;
if
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
{
return
d3d11FormatInfo
.
mDSVFormat
;
}
...
...
@@ -829,7 +829,7 @@ namespace d3d11_gl
GLint
GetInternalFormat
(
DXGI_FORMAT
format
)
{
DXGIFormatInfo
formatInfo
;
if
(
g
etDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
formatInfo
))
{
return
formatInfo
.
mInternalFormat
;
}
...
...
src/libGLESv2/renderer/formatutils9.cpp
View file @
18591b7c
...
...
@@ -85,7 +85,7 @@ const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
typedef
std
::
pair
<
GLint
,
D3D9FormatInfo
>
D3D9FormatPair
;
typedef
std
::
map
<
GLint
,
D3D9FormatInfo
>
D3D9FormatMap
;
static
D3D9FormatMap
b
uildD3D9FormatMap
()
static
D3D9FormatMap
B
uildD3D9FormatMap
()
{
D3D9FormatMap
map
;
...
...
@@ -134,9 +134,9 @@ static D3D9FormatMap buildD3D9FormatMap()
return
map
;
}
static
bool
g
etD3D9FormatInfo
(
GLint
internalFormat
,
D3D9FormatInfo
*
outFormatInfo
)
static
bool
G
etD3D9FormatInfo
(
GLint
internalFormat
,
D3D9FormatInfo
*
outFormatInfo
)
{
static
const
D3D9FormatMap
formatMap
=
b
uildD3D9FormatMap
();
static
const
D3D9FormatMap
formatMap
=
B
uildD3D9FormatMap
();
D3D9FormatMap
::
const_iterator
iter
=
formatMap
.
find
(
internalFormat
);
if
(
iter
!=
formatMap
.
end
())
{
...
...
@@ -176,7 +176,7 @@ struct D3DFormatInfo
typedef
std
::
pair
<
D3DFORMAT
,
D3DFormatInfo
>
D3D9FormatInfoPair
;
typedef
std
::
map
<
D3DFORMAT
,
D3DFormatInfo
>
D3D9FormatInfoMap
;
static
D3D9FormatInfoMap
b
uildD3D9FormatInfoMap
()
static
D3D9FormatInfoMap
B
uildD3D9FormatInfoMap
()
{
D3D9FormatInfoMap
map
;
...
...
@@ -211,11 +211,11 @@ static D3D9FormatInfoMap buildD3D9FormatInfoMap()
static
const
D3D9FormatInfoMap
&
GetD3D9FormatInfoMap
()
{
static
const
D3D9FormatInfoMap
infoMap
=
b
uildD3D9FormatInfoMap
();
static
const
D3D9FormatInfoMap
infoMap
=
B
uildD3D9FormatInfoMap
();
return
infoMap
;
}
static
bool
g
etD3D9FormatInfo
(
D3DFORMAT
format
,
D3DFormatInfo
*
outFormatInfo
)
static
bool
G
etD3D9FormatInfo
(
D3DFORMAT
format
,
D3DFormatInfo
*
outFormatInfo
)
{
const
D3D9FormatInfoMap
&
infoMap
=
GetD3D9FormatInfoMap
();
D3D9FormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
...
...
@@ -251,7 +251,7 @@ namespace d3d9
MipGenerationFunction
GetMipGenerationFunction
(
D3DFORMAT
format
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
return
d3dFormatInfo
.
mMipGenerationFunction
;
}
...
...
@@ -272,7 +272,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re
ASSERT
(
renderer
->
getCurrentClientVersion
()
==
2
);
D3D9FormatInfo
d3d9FormatInfo
;
if
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
{
return
d3d9FormatInfo
.
mLoadFunction
(
renderer
);
}
...
...
@@ -286,7 +286,7 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, const Renderer9 *re
GLuint
GetFormatPixelBytes
(
D3DFORMAT
format
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
return
d3dFormatInfo
.
mPixelBits
/
8
;
}
...
...
@@ -300,7 +300,7 @@ GLuint GetFormatPixelBytes(D3DFORMAT format)
GLuint
GetBlockWidth
(
D3DFORMAT
format
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
return
d3dFormatInfo
.
mBlockWidth
;
}
...
...
@@ -314,7 +314,7 @@ GLuint GetBlockWidth(D3DFORMAT format)
GLuint
GetBlockHeight
(
D3DFORMAT
format
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
return
d3dFormatInfo
.
mBlockHeight
;
}
...
...
@@ -328,7 +328,7 @@ GLuint GetBlockHeight(D3DFORMAT format)
GLuint
GetBlockSize
(
D3DFORMAT
format
,
GLuint
width
,
GLuint
height
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
GLuint
numBlocksWide
=
(
width
+
d3dFormatInfo
.
mBlockWidth
-
1
)
/
d3dFormatInfo
.
mBlockWidth
;
GLuint
numBlocksHight
=
(
height
+
d3dFormatInfo
.
mBlockHeight
-
1
)
/
d3dFormatInfo
.
mBlockHeight
;
...
...
@@ -345,7 +345,7 @@ GLuint GetBlockSize(D3DFORMAT format, GLuint width, GLuint height)
void
MakeValidSize
(
bool
isImage
,
D3DFORMAT
format
,
GLsizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
)
{
D3DFormatInfo
d3dFormatInfo
;
if
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
{
int
upsampleCount
=
0
;
...
...
@@ -388,7 +388,7 @@ D3DFORMAT GetTexureFormat(GLint internalFormat, const Renderer9 *renderer)
ASSERT
(
renderer
->
getCurrentClientVersion
()
==
2
);
D3D9FormatInfo
d3d9FormatInfo
;
if
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
{
return
d3d9FormatInfo
.
mTexFormat
(
renderer
);
}
...
...
@@ -410,7 +410,7 @@ D3DFORMAT GetRenderFormat(GLint internalFormat, const Renderer9 *renderer)
ASSERT
(
renderer
->
getCurrentClientVersion
()
==
2
);
D3D9FormatInfo
d3d9FormatInfo
;
if
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
{
return
d3d9FormatInfo
.
mRenderFormat
(
renderer
);
}
...
...
@@ -433,7 +433,7 @@ namespace d3d9_gl
GLint
GetInternalFormat
(
D3DFORMAT
format
)
{
static
const
D3D9FormatInfoMap
infoMap
=
b
uildD3D9FormatInfoMap
();
static
const
D3D9FormatInfoMap
infoMap
=
B
uildD3D9FormatInfoMap
();
D3D9FormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
if
(
iter
!=
infoMap
.
end
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment