Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fa6dba88
Commit
fa6dba88
authored
Apr 23, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use vector types in wined3d_format_convert_from_float().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9ce5b409
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
33 deletions
+35
-33
utils.c
dlls/wined3d/utils.c
+27
-33
wined3d.h
include/wine/wined3d.h
+8
-0
No files found.
dlls/wined3d/utils.c
View file @
fa6dba88
...
...
@@ -4971,38 +4971,32 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
static
const
struct
{
enum
wined3d_format_id
format_id
;
float
r_mul
;
float
g_mul
;
float
b_mul
;
float
a_mul
;
BYTE
r_shift
;
BYTE
g_shift
;
BYTE
b_shift
;
BYTE
a_shift
;
struct
wined3d_vec4
mul
;
struct
wined3d_uvec4
shift
;
}
conv
[]
=
{
{
WINED3DFMT_B8G8R8A8_UNORM
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
16
,
8
,
0
,
24
},
{
WINED3DFMT_B8G8R8X8_UNORM
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
16
,
8
,
0
,
24
},
{
WINED3DFMT_B8G8R8_UNORM
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
16
,
8
,
0
,
24
},
{
WINED3DFMT_B5G6R5_UNORM
,
31
.
0
f
,
63
.
0
f
,
31
.
0
f
,
0
.
0
f
,
11
,
5
,
0
,
0
},
{
WINED3DFMT_B5G5R5A1_UNORM
,
31
.
0
f
,
31
.
0
f
,
31
.
0
f
,
1
.
0
f
,
10
,
5
,
0
,
15
},
{
WINED3DFMT_B5G5R5X1_UNORM
,
31
.
0
f
,
31
.
0
f
,
31
.
0
f
,
1
.
0
f
,
10
,
5
,
0
,
15
},
{
WINED3DFMT_R8_UNORM
,
255
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_A8_UNORM
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
255
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_B4G4R4A4_UNORM
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
8
,
4
,
0
,
12
},
{
WINED3DFMT_B4G4R4X4_UNORM
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
8
,
4
,
0
,
12
},
{
WINED3DFMT_B2G3R3_UNORM
,
7
.
0
f
,
7
.
0
f
,
3
.
0
f
,
0
.
0
f
,
5
,
2
,
0
,
0
},
{
WINED3DFMT_R8G8B8A8_UNORM
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
0
,
8
,
16
,
24
},
{
WINED3DFMT_R8G8B8X8_UNORM
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
0
,
8
,
16
,
24
},
{
WINED3DFMT_B10G10R10A2_UNORM
,
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
,
20
,
10
,
0
,
30
},
{
WINED3DFMT_R10G10B10A2_UNORM
,
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
,
0
,
10
,
20
,
30
},
{
WINED3DFMT_P8_UINT
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
255
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_S1_UINT_D15_UNORM
,
32767
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_D16_UNORM
,
65535
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_D24_UNORM_S8_UINT
,
16777215
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_X8D24_UNORM
,
16777215
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_D32_UNORM
,
4294967295
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_B8G8R8A8_UNORM
,
{
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
},
{
16
,
8
,
0
,
24
}
},
{
WINED3DFMT_B8G8R8X8_UNORM
,
{
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
},
{
16
,
8
,
0
,
24
}
},
{
WINED3DFMT_B8G8R8_UNORM
,
{
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
},
{
16
,
8
,
0
,
24
}
},
{
WINED3DFMT_B5G6R5_UNORM
,
{
31
.
0
f
,
63
.
0
f
,
31
.
0
f
,
0
.
0
f
},
{
11
,
5
,
0
,
0
}
},
{
WINED3DFMT_B5G5R5A1_UNORM
,
{
31
.
0
f
,
31
.
0
f
,
31
.
0
f
,
1
.
0
f
},
{
10
,
5
,
0
,
15
}
},
{
WINED3DFMT_B5G5R5X1_UNORM
,
{
31
.
0
f
,
31
.
0
f
,
31
.
0
f
,
1
.
0
f
},
{
10
,
5
,
0
,
15
}
},
{
WINED3DFMT_R8_UNORM
,
{
255
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_A8_UNORM
,
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
255
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_B4G4R4A4_UNORM
,
{
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
},
{
8
,
4
,
0
,
12
}
},
{
WINED3DFMT_B4G4R4X4_UNORM
,
{
15
.
0
f
,
15
.
0
f
,
15
.
0
f
,
15
.
0
f
},
{
8
,
4
,
0
,
12
}
},
{
WINED3DFMT_B2G3R3_UNORM
,
{
7
.
0
f
,
7
.
0
f
,
3
.
0
f
,
0
.
0
f
},
{
5
,
2
,
0
,
0
}
},
{
WINED3DFMT_R8G8B8A8_UNORM
,
{
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
},
{
0
,
8
,
16
,
24
}
},
{
WINED3DFMT_R8G8B8X8_UNORM
,
{
255
.
0
f
,
255
.
0
f
,
255
.
0
f
,
255
.
0
f
},
{
0
,
8
,
16
,
24
}
},
{
WINED3DFMT_B10G10R10A2_UNORM
,
{
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
},
{
20
,
10
,
0
,
30
}
},
{
WINED3DFMT_R10G10B10A2_UNORM
,
{
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
},
{
0
,
10
,
20
,
30
}
},
{
WINED3DFMT_P8_UINT
,
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
255
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_S1_UINT_D15_UNORM
,
{
32767
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_D16_UNORM
,
{
65535
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_D24_UNORM_S8_UINT
,
{
16777215
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_X8D24_UNORM
,
{
16777215
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
{
WINED3DFMT_D32_UNORM
,
{
4294967295
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
,
0
,
0
,
0
}
},
};
unsigned
int
i
;
...
...
@@ -5014,10 +5008,10 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
if
(
format
->
id
!=
conv
[
i
].
format_id
)
continue
;
ret
=
((
DWORD
)((
color
->
r
*
conv
[
i
].
r_mul
)
+
0
.
5
f
))
<<
conv
[
i
].
r_shift
;
ret
|=
((
DWORD
)((
color
->
g
*
conv
[
i
].
g_mul
)
+
0
.
5
f
))
<<
conv
[
i
].
g_shift
;
ret
|=
((
DWORD
)((
color
->
b
*
conv
[
i
].
b_mul
)
+
0
.
5
f
))
<<
conv
[
i
].
b_shift
;
ret
|=
((
DWORD
)((
color
->
a
*
conv
[
i
].
a_mul
)
+
0
.
5
f
))
<<
conv
[
i
].
a_shift
;
ret
=
((
DWORD
)((
color
->
r
*
conv
[
i
].
mul
.
x
)
+
0
.
5
f
))
<<
conv
[
i
].
shift
.
x
;
ret
|=
((
DWORD
)((
color
->
g
*
conv
[
i
].
mul
.
y
)
+
0
.
5
f
))
<<
conv
[
i
].
shift
.
y
;
ret
|=
((
DWORD
)((
color
->
b
*
conv
[
i
].
mul
.
z
)
+
0
.
5
f
))
<<
conv
[
i
].
shift
.
z
;
ret
|=
((
DWORD
)((
color
->
a
*
conv
[
i
].
mul
.
w
)
+
0
.
5
f
))
<<
conv
[
i
].
shift
.
w
;
TRACE
(
"Returning 0x%08x.
\n
"
,
ret
);
...
...
include/wine/wined3d.h
View file @
fa6dba88
...
...
@@ -1567,6 +1567,14 @@ struct wined3d_ivec4
int
w
;
};
struct
wined3d_uvec4
{
unsigned
int
x
;
unsigned
int
y
;
unsigned
int
z
;
unsigned
int
w
;
};
struct
wined3d_matrix
{
float
_11
,
_12
,
_13
,
_14
;
...
...
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