Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5c635f41
Commit
5c635f41
authored
Apr 12, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move D15S1 over to the formats table.
parent
6a081ef9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
35 deletions
+26
-35
surface.c
dlls/wined3d/surface.c
+0
-31
utils.c
dlls/wined3d/utils.c
+26
-4
No files found.
dlls/wined3d/surface.c
View file @
5c635f41
...
...
@@ -2250,15 +2250,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
desc
->
conv_byte_count
=
12
;
break
;
case
WINED3DFMT_S1_UINT_D15_UNORM
:
if
(
gl_info
->
supported
[
ARB_FRAMEBUFFER_OBJECT
]
||
gl_info
->
supported
[
EXT_PACKED_DEPTH_STENCIL
])
{
*
convert
=
CONVERT_D15S1
;
desc
->
conv_byte_count
=
4
;
}
break
;
default:
break
;
}
...
...
@@ -2565,28 +2556,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
break
;
}
case
CONVERT_D15S1
:
{
unsigned
int
x
,
y
;
for
(
y
=
0
;
y
<
height
;
++
y
)
{
const
WORD
*
source
=
(
const
WORD
*
)(
src
+
y
*
pitch
);
DWORD
*
dest
=
(
DWORD
*
)(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
++
x
)
{
/* The depth data is normalized, so needs to be scaled,
* the stencil data isn't. Scale depth data by
* (2^24-1)/(2^15-1) ~~ (2^9 + 2^-6). */
WORD
d15
=
source
[
x
]
>>
1
;
DWORD
d24
=
(
d15
<<
9
)
+
(
d15
>>
6
);
dest
[
x
]
=
(
d24
<<
8
)
|
(
source
[
x
]
&
0x1
);
}
}
break
;
}
default:
ERR
(
"Unsupported conversion type %#x.
\n
"
,
convert
);
}
...
...
dlls/wined3d/utils.c
View file @
5c635f41
...
...
@@ -417,6 +417,28 @@ static void convert_r16g16_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT wi
}
}
static
void
convert_s1_uint_d15_unorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
UINT
outpitch
=
pitch
*
2
;
for
(
y
=
0
;
y
<
height
;
++
y
)
{
const
WORD
*
source
=
(
const
WORD
*
)(
src
+
y
*
pitch
);
DWORD
*
dest
=
(
DWORD
*
)(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
++
x
)
{
/* The depth data is normalized, so needs to be scaled,
* the stencil data isn't. Scale depth data by
* (2^24-1)/(2^15-1) ~~ (2^9 + 2^-6). */
WORD
d15
=
source
[
x
]
>>
1
;
DWORD
d24
=
(
d15
<<
9
)
+
(
d15
>>
6
);
dest
[
x
]
=
(
d24
<<
8
)
|
(
source
[
x
]
&
0x1
);
}
}
}
static
void
convert_s4x4_uint_d24_unorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
...
...
@@ -690,13 +712,13 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_DEPTH
,
ARB_DEPTH_TEXTURE
,
NULL
},
{
WINED3DFMT_S1_UINT_D15_UNORM
,
GL_DEPTH24_STENCIL8_EXT
,
GL_DEPTH24_STENCIL8_EXT
,
0
,
GL_DEPTH_STENCIL_EXT
,
GL_UNSIGNED_INT_24_8_EXT
,
0
,
GL_DEPTH_STENCIL_EXT
,
GL_UNSIGNED_INT_24_8_EXT
,
4
,
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
,
EXT_PACKED_DEPTH_STENCIL
,
NULL
},
EXT_PACKED_DEPTH_STENCIL
,
&
convert_s1_uint_d15_unorm
},
{
WINED3DFMT_S1_UINT_D15_UNORM
,
GL_DEPTH24_STENCIL8
,
GL_DEPTH24_STENCIL8
,
0
,
GL_DEPTH_STENCIL
,
GL_UNSIGNED_INT_24_8
,
0
,
GL_DEPTH_STENCIL
,
GL_UNSIGNED_INT_24_8
,
4
,
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
,
ARB_FRAMEBUFFER_OBJECT
,
NULL
},
ARB_FRAMEBUFFER_OBJECT
,
&
convert_s1_uint_d15_unorm
},
{
WINED3DFMT_D24_UNORM_S8_UINT
,
GL_DEPTH_COMPONENT24_ARB
,
GL_DEPTH_COMPONENT24_ARB
,
0
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_INT
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
|
WINED3DFMT_FLAG_DEPTH
,
...
...
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