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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
40 deletions
+40
-40
formatutils.cpp
src/libGLESv2/formatutils.cpp
+0
-0
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
This diff is collapsed.
Click to expand it.
src/libGLESv2/renderer/formatutils11.cpp
View file @
18591b7c
...
@@ -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
b
uildD3D11ES3FormatMap
()
static
D3D11ES3FormatMap
B
uildD3D11ES3FormatMap
()
{
{
D3D11ES3FormatMap
map
;
D3D11ES3FormatMap
map
;
...
@@ -152,9 +152,9 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
...
@@ -152,9 +152,9 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
return
map
;
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
);
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
b
uildD3D11ES2FormatMap
()
static
D3D11ES2FormatMap
B
uildD3D11ES2FormatMap
()
{
{
D3D11ES2FormatMap
map
;
D3D11ES2FormatMap
map
;
...
@@ -399,9 +399,9 @@ static D3D11ES2FormatMap buildD3D11ES2FormatMap()
...
@@ -399,9 +399,9 @@ static D3D11ES2FormatMap buildD3D11ES2FormatMap()
return
map
;
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
);
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
b
uildDXGIFormatInfoMap
()
static
DXGIFormatInfoMap
B
uildDXGIFormatInfoMap
()
{
{
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
=
b
uildDXGIFormatInfoMap
();
static
const
DXGIFormatInfoMap
infoMap
=
B
uildDXGIFormatInfoMap
();
return
infoMap
;
return
infoMap
;
}
}
static
bool
g
etDXGIFormatInfo
(
DXGI_FORMAT
format
,
DXGIFormatInfo
*
outFormatInfo
)
static
bool
G
etDXGIFormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
G
etDXGIFormatInfo
(
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
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
G
etDXGIFormatInfo
(
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
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
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
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
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
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
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
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
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
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
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
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
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
(
g
etD3D11ES2FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES2FormatInfo
(
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
(
g
etD3D11ES3FormatInfo
(
internalFormat
,
clientVersion
,
&
d3d11FormatInfo
))
if
(
G
etD3D11ES3FormatInfo
(
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
(
g
etDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
G
etDXGIFormatInfo
(
format
,
&
formatInfo
))
{
{
return
formatInfo
.
mInternalFormat
;
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')));
...
@@ -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
b
uildD3D9FormatMap
()
static
D3D9FormatMap
B
uildD3D9FormatMap
()
{
{
D3D9FormatMap
map
;
D3D9FormatMap
map
;
...
@@ -134,9 +134,9 @@ static D3D9FormatMap buildD3D9FormatMap()
...
@@ -134,9 +134,9 @@ static D3D9FormatMap buildD3D9FormatMap()
return
map
;
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
);
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
b
uildD3D9FormatInfoMap
()
static
D3D9FormatInfoMap
B
uildD3D9FormatInfoMap
()
{
{
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
=
b
uildD3D9FormatInfoMap
();
static
const
D3D9FormatInfoMap
infoMap
=
B
uildD3D9FormatInfoMap
();
return
infoMap
;
return
infoMap
;
}
}
static
bool
g
etD3D9FormatInfo
(
D3DFORMAT
format
,
D3DFormatInfo
*
outFormatInfo
)
static
bool
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
format
,
&
d3dFormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
(
g
etD3D9FormatInfo
(
internalFormat
,
&
d3d9FormatInfo
))
if
(
G
etD3D9FormatInfo
(
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
=
b
uildD3D9FormatInfoMap
();
static
const
D3D9FormatInfoMap
infoMap
=
B
uildD3D9FormatInfoMap
();
D3D9FormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
D3D9FormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
if
(
iter
!=
infoMap
.
end
())
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