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
4133f5c2
Commit
4133f5c2
authored
Oct 10, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
24bit depth formats need to flip the depth and stencil bits when loading.
TRAC #23540 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
parent
85ea9abb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
formatutils11.cpp
src/libGLESv2/renderer/d3d11/formatutils11.cpp
+2
-2
loadimage.cpp
src/libGLESv2/renderer/loadimage.cpp
+25
-0
loadimage.h
src/libGLESv2/renderer/loadimage.h
+4
-0
No files found.
src/libGLESv2/renderer/d3d11/formatutils11.cpp
View file @
4133f5c2
...
@@ -268,10 +268,10 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
...
@@ -268,10 +268,10 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction
(
&
map
,
GL_R32UI
,
GL_UNSIGNED_INT
,
loadToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_R32UI
,
GL_UNSIGNED_INT
,
loadToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_R32I
,
GL_INT
,
loadToNative
<
GLint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_R32I
,
GL_INT
,
loadToNative
<
GLint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_SHORT
,
loadToNative
<
GLushort
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_SHORT
,
loadToNative
<
GLushort
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT24
,
GL_UNSIGNED_INT
,
load
ToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT24
,
GL_UNSIGNED_INT
,
load
G8R24DataToR24G8
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_INT
,
loadUintDataToUshort
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT16
,
GL_UNSIGNED_INT
,
loadUintDataToUshort
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT32F
,
GL_FLOAT
,
loadToNative
<
GLfloat
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH_COMPONENT32F
,
GL_FLOAT
,
loadToNative
<
GLfloat
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH24_STENCIL8
,
GL_UNSIGNED_INT_24_8
,
load
ToNative
<
GLuint
,
1
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH24_STENCIL8
,
GL_UNSIGNED_INT_24_8
,
load
G8R24DataToR24G8
);
insertLoadFunction
(
&
map
,
GL_DEPTH32F_STENCIL8
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
loadToNative
<
GLuint
,
2
>
);
insertLoadFunction
(
&
map
,
GL_DEPTH32F_STENCIL8
,
GL_FLOAT_32_UNSIGNED_INT_24_8_REV
,
loadToNative
<
GLuint
,
2
>
);
// Unsized formats
// Unsized formats
...
...
src/libGLESv2/renderer/loadimage.cpp
View file @
4133f5c2
...
@@ -828,6 +828,31 @@ void loadRGBFloatDataTo111110Float(int width, int height, int depth,
...
@@ -828,6 +828,31 @@ void loadRGBFloatDataTo111110Float(int width, int height, int depth,
}
}
}
}
void
loadG8R24DataToR24G8
(
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
int
*
dest
=
NULL
;
for
(
int
z
=
0
;
z
<
depth
;
z
++
)
{
for
(
int
y
=
0
;
y
<
height
;
y
++
)
{
source
=
offsetDataPointer
<
const
unsigned
int
>
(
input
,
y
,
z
,
inputRowPitch
,
inputDepthPitch
);
dest
=
offsetDataPointer
<
unsigned
int
>
(
output
,
y
,
z
,
outputRowPitch
,
outputDepthPitch
);
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
unsigned
int
depth
=
source
[
x
]
>>
8
;
unsigned
int
stencil
=
source
[
x
]
&
0xFF
;
dest
[
x
]
=
depth
|
(
stencil
<<
24
);
}
}
}
}
void
loadFloatRGBDataToHalfFloatRGBA
(
int
width
,
int
height
,
int
depth
,
void
loadFloatRGBDataToHalfFloatRGBA
(
int
width
,
int
height
,
int
depth
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
)
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
)
...
...
src/libGLESv2/renderer/loadimage.h
View file @
4133f5c2
...
@@ -178,6 +178,10 @@ void loadRGBFloatDataTo111110Float(int width, int height, int depth,
...
@@ -178,6 +178,10 @@ void loadRGBFloatDataTo111110Float(int width, int height, int depth,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
);
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
);
void
loadG8R24DataToR24G8
(
int
width
,
int
height
,
int
depth
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
void
*
output
,
unsigned
int
outputRowPitch
,
unsigned
int
outputDepthPitch
);
template
<
typename
type
,
unsigned
int
componentCount
>
template
<
typename
type
,
unsigned
int
componentCount
>
void
loadToNative
(
int
width
,
int
height
,
int
depth
,
void
loadToNative
(
int
width
,
int
height
,
int
depth
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
const
void
*
input
,
unsigned
int
inputRowPitch
,
unsigned
int
inputDepthPitch
,
...
...
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