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
ce836bf6
Commit
ce836bf6
authored
Mar 07, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Properly up-scale WINED3DFMT_R5G5_SNORM_L6_UNORM.
parent
44ddcac6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
utils.c
dlls/wined3d/utils.c
+20
-19
No files found.
dlls/wined3d/utils.c
View file @
ce836bf6
...
...
@@ -322,8 +322,8 @@ static void convert_r5g5_snorm_l6_unorm_nv(const BYTE *src, BYTE *dst, UINT src_
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
UINT
width
,
UINT
height
,
UINT
depth
)
{
unsigned
int
x
,
y
,
z
;
const
WORD
*
Source
;
unsigned
char
*
Dest
;
unsigned
char
*
texel_out
,
ds_out
,
dt_out
,
r_in
,
g_in
,
l_in
;
const
unsigned
short
*
texel_in
;
/* This makes the gl surface bigger(24 bit instead of 16), but it works with
* fixed function and shaders without further conversion once the surface is
...
...
@@ -333,27 +333,28 @@ static void convert_r5g5_snorm_l6_unorm_nv(const BYTE *src, BYTE *dst, UINT src_
{
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
WORD
*
)(
src
+
z
*
src_slice_pitch
+
y
*
src_row_pitch
);
Des
t
=
dst
+
z
*
dst_slice_pitch
+
y
*
dst_row_pitch
;
texel_in
=
(
const
unsigned
short
*
)(
src
+
z
*
src_slice_pitch
+
y
*
src_row_pitch
);
texel_ou
t
=
dst
+
z
*
dst_slice_pitch
+
y
*
dst_row_pitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
short
color
=
(
*
Source
++
);
unsigned
char
l
=
((
color
>>
10
)
&
0xfc
);
char
v
=
((
color
>>
5
)
&
0x3e
);
char
u
=
((
color
)
&
0x1f
);
l_in
=
(
*
texel_in
&
0xfc00
)
>>
10
;
g_in
=
(
*
texel_in
&
0x03e0
)
>>
5
;
r_in
=
*
texel_in
&
0x001f
;
/* 8 bits destination, 6 bits source, 8th bit is the sign. gl ignores the sign
* and doubles the positive range. Thus shift left only once, gl does the 2nd
* shift. GL reads a signed value and converts it into an unsigned value.
*/
/* M */
Dest
[
2
]
=
l
<<
1
;
ds_out
=
r_in
<<
3
;
if
(
!
(
r_in
&
0x10
))
/* r > 0 */
ds_out
|=
r_in
>>
1
;
/* Those are read as signed, but kept signed. Just left-shift 3 times to scale
* from 5 bit values to 8 bit values.
*/
/* V */
Dest
[
1
]
=
v
<<
3
;
/* U */
Dest
[
0
]
=
u
<<
3
;
Dest
+=
3
;
dt_out
=
g_in
<<
3
;
if
(
!
(
g_in
&
0x10
))
/* g > 0 */
dt_out
|=
g_in
>>
1
;
texel_out
[
0
]
=
ds_out
;
texel_out
[
1
]
=
dt_out
;
texel_out
[
2
]
=
l_in
<<
1
|
l_in
>>
5
;
texel_out
+=
3
;
texel_in
++
;
}
}
}
...
...
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