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
cc31ca88
Commit
cc31ca88
authored
Jun 07, 2021
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce wined3d_mask_from_size().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
736c4803
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
surface.c
dlls/wined3d/surface.c
+4
-4
utils.c
dlls/wined3d/utils.c
+5
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/surface.c
View file @
cc31ca88
...
...
@@ -36,11 +36,11 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
static
const
DWORD
surface_simple_locations
=
WINED3D_LOCATION_SYSMEM
|
WINED3D_LOCATION_BUFFER
;
/* Works correctly only for <= 4 bpp formats. */
static
void
get_color_masks
(
const
struct
wined3d_format
*
format
,
DWORD
*
masks
)
static
void
get_color_masks
(
const
struct
wined3d_format
*
format
,
uint32_t
*
masks
)
{
masks
[
0
]
=
((
1u
<<
format
->
red_size
)
-
1
)
<<
format
->
red_offset
;
masks
[
1
]
=
((
1u
<<
format
->
green_size
)
-
1
)
<<
format
->
green_offset
;
masks
[
2
]
=
((
1u
<<
format
->
blue_size
)
-
1
)
<<
format
->
blue_offset
;
masks
[
0
]
=
wined3d_mask_from_size
(
format
->
red_size
)
<<
format
->
red_offset
;
masks
[
1
]
=
wined3d_mask_from_size
(
format
->
green_size
)
<<
format
->
green_offset
;
masks
[
2
]
=
wined3d_mask_from_size
(
format
->
blue_size
)
<<
format
->
blue_offset
;
}
/* See also float_16_to_32() in wined3d_private.h */
...
...
dlls/wined3d/utils.c
View file @
cc31ca88
...
...
@@ -5902,7 +5902,7 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
static
float
color_to_float
(
DWORD
color
,
DWORD
size
,
DWORD
offset
)
{
DWORD
mask
=
size
<
32
?
(
1u
<<
size
)
-
1
:
~
0u
;
uint32_t
mask
=
wined3d_mask_from_size
(
size
)
;
if
(
!
size
)
return
1
.
0
f
;
...
...
@@ -5938,10 +5938,10 @@ void wined3d_format_get_float_color_key(const struct wined3d_format *format,
case
WINED3DFMT_R8G8B8X8_UNORM
:
case
WINED3DFMT_R16G16_UNORM
:
case
WINED3DFMT_B10G10R10A2_UNORM
:
slop
.
r
=
0
.
5
f
/
((
1u
<<
format
->
red_size
)
-
1
);
slop
.
g
=
0
.
5
f
/
((
1u
<<
format
->
green_size
)
-
1
);
slop
.
b
=
0
.
5
f
/
((
1u
<<
format
->
blue_size
)
-
1
);
slop
.
a
=
0
.
5
f
/
((
1u
<<
format
->
alpha_size
)
-
1
);
slop
.
r
=
0
.
5
f
/
wined3d_mask_from_size
(
format
->
red_size
);
slop
.
g
=
0
.
5
f
/
wined3d_mask_from_size
(
format
->
green_size
);
slop
.
b
=
0
.
5
f
/
wined3d_mask_from_size
(
format
->
blue_size
);
slop
.
a
=
0
.
5
f
/
wined3d_mask_from_size
(
format
->
alpha_size
);
float_colors
[
0
].
r
=
color_to_float
(
key
->
color_space_low_value
,
format
->
red_size
,
format
->
red_offset
)
-
slop
.
r
;
...
...
dlls/wined3d/wined3d_private.h
View file @
cc31ca88
...
...
@@ -5959,6 +5959,11 @@ static inline BOOL is_rasterization_disabled(const struct wined3d_shader *geomet
&&
geometry_shader
->
u
.
gs
.
so_desc
->
rasterizer_stream_idx
==
WINED3D_NO_RASTERIZER_STREAM
;
}
static
inline
uint32_t
wined3d_mask_from_size
(
unsigned
int
size
)
{
return
size
<
32
?
(
1u
<<
size
)
-
1
:
~
0u
;
}
static
inline
DWORD
wined3d_extract_bits
(
const
DWORD
*
bitstream
,
unsigned
int
offset
,
unsigned
int
count
)
{
...
...
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