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
87465460
Commit
87465460
authored
Jun 17, 2013
by
Geoff Lang
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added load functions to depth texture formats.
TRAC #23262 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent
a3495326
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
11 deletions
+37
-11
formatutils11.cpp
src/libGLESv2/renderer/formatutils11.cpp
+11
-11
loadimage.cpp
src/libGLESv2/renderer/loadimage.cpp
+22
-0
loadimage.h
src/libGLESv2/renderer/loadimage.h
+4
-0
No files found.
src/libGLESv2/renderer/formatutils11.cpp
View file @
87465460
...
...
@@ -266,12 +266,12 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction
(
&
map
,
GL_R16I
,
GL_SHORT
,
loadToNative
<
GLshort
,
1
>
);
insertLoadFunction
(
&
map
,
GL_R32UI
,
GL_UNSIGNED_INT
,
loadToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_R32I
,
GL_INT
,
loadToNative
<
GLint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_SHORT
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT24
,
GL_UNSIGNED_INT
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_INT
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT32F
,
GL_FLOAT
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH24_STENCIL8
,
GL_UNSIGNED_INT_24_8
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH32F_STENCIL8
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
UnimplementedLoadFunction
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_SHORT
,
loadToNative
<
GLushort
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT24
,
GL_UNSIGNED_INT
,
loadToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_INT
,
loadUintDataToUshort
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT32F
,
GL_FLOAT
,
loadToNative
<
GLfloat
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH24_STENCIL8
,
GL_UNSIGNED_INT_24_8
,
loadToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH32F_STENCIL8
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
loadToNative
<
GLuint
,
2
>
);
// Unsized formats
// Load functions are unreachable because they are converted to sized internal formats based on
...
...
@@ -370,11 +370,11 @@ static D3D11ES2FormatMap BuildD3D11ES2FormatMap()
D3D11ES2FormatMap
map
;
// | Internal format | | Texture format | SRV format | RTV format | DSV format | Load function |
map
.
insert
(
D3D11ES2FormatPair
(
GL_NONE
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
NULL
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH_COMPONENT16
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R16_TYPELESS
,
DXGI_FORMAT_R16_UNORM
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D16_UNORM
,
NULL
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH_COMPONENT32_OES
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R32_TYPELESS
,
DXGI_FORMAT_R32_FLOAT
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D32_FLOAT
,
NULL
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH24_STENCIL8_OES
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R24G8_TYPELESS
,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D24_UNORM_S8_UINT
,
NULL
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_STENCIL_INDEX8
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R24G8_TYPELESS
,
DXGI_FORMAT_X24_TYPELESS_G8_UINT
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D24_UNORM_S8_UINT
,
NULL
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_NONE
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_UNKNOWN
,
UnreachableLoadFunction
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH_COMPONENT16
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R16_TYPELESS
,
DXGI_FORMAT_R16_UNORM
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D16_UNORM
,
UnreachableLoadFunction
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH_COMPONENT32_OES
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R32_TYPELESS
,
DXGI_FORMAT_R32_FLOAT
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D32_FLOAT
,
UnreachableLoadFunction
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_DEPTH24_STENCIL8_OES
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R24G8_TYPELESS
,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D24_UNORM_S8_UINT
,
UnreachableLoadFunction
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_STENCIL_INDEX8
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R24G8_TYPELESS
,
DXGI_FORMAT_X24_TYPELESS_G8_UINT
,
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_D24_UNORM_S8_UINT
,
UnreachableLoadFunction
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_RGBA32F_EXT
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R32G32B32A32_FLOAT
,
DXGI_FORMAT_R32G32B32A32_FLOAT
,
DXGI_FORMAT_R32G32B32A32_FLOAT
,
DXGI_FORMAT_UNKNOWN
,
loadRGBAFloatDataToRGBA
)));
map
.
insert
(
D3D11ES2FormatPair
(
GL_RGB32F_EXT
,
D3D11ES2FormatInfo
(
DXGI_FORMAT_R32G32B32_FLOAT
,
DXGI_FORMAT_R32G32B32_FLOAT
,
DXGI_FORMAT_R32G32B32_FLOAT
,
DXGI_FORMAT_UNKNOWN
,
loadRGBFloatDataToNative
)));
...
...
src/libGLESv2/renderer/loadimage.cpp
View file @
87465460
...
...
@@ -853,4 +853,26 @@ void loadFloatRGBDataToHalfFloatRGBA(int width, int height, int depth,
}
}
void
loadUintDataToUshort
(
int
width
,
int
height
,
int
depth
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
)
{
const
unsigned
int
*
source
=
NULL
;
unsigned
short
*
dest
=
NULL
;
for
(
int
z
=
0
;
z
<
depth
;
z
++
)
{
for
(
int
y
=
0
;
y
<
height
;
y
++
)
{
source
=
offsetDataPointer
<
unsigned
int
>
(
input
,
y
,
z
,
inputRowPitch
,
inputDepthPitch
);
dest
=
offsetDataPointer
<
unsigned
short
>
(
output
,
y
,
z
,
outputRowPitch
,
outputDepthPitch
);
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
dest
[
x
]
=
source
[
x
]
>>
16
;
}
}
}
}
}
src/libGLESv2/renderer/loadimage.h
View file @
87465460
...
...
@@ -294,6 +294,10 @@ void loadCompressedBlockDataToNative(int width, int height, int depth,
}
}
void
loadUintDataToUshort
(
int
width
,
int
height
,
int
depth
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
);
}
#endif // LIBGLESV2_RENDERER_LOADIMAGE_H_
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