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
7bca617c
Commit
7bca617c
authored
Apr 02, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11/tests: Introduce and use check_readback_data_u24.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
310849de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
15 deletions
+43
-15
d3d11.c
dlls/d3d11/tests/d3d11.c
+43
-15
No files found.
dlls/d3d11/tests/d3d11.c
View file @
7bca617c
...
...
@@ -946,11 +946,16 @@ static WORD get_readback_u16(struct resource_readback *rb, unsigned int x, unsig
return
*
(
WORD
*
)
get_readback_data
(
rb
,
x
,
y
,
z
,
sizeof
(
WORD
));
}
static
DWORD
get_readback_
color
(
struct
resource_readback
*
rb
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
z
)
static
DWORD
get_readback_
u32
(
struct
resource_readback
*
rb
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
z
)
{
return
*
(
DWORD
*
)
get_readback_data
(
rb
,
x
,
y
,
z
,
sizeof
(
DWORD
));
}
static
DWORD
get_readback_color
(
struct
resource_readback
*
rb
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
z
)
{
return
get_readback_u32
(
rb
,
x
,
y
,
z
);
}
static
float
get_readback_float
(
struct
resource_readback
*
rb
,
unsigned
int
x
,
unsigned
int
y
)
{
return
*
(
float
*
)
get_readback_data
(
rb
,
x
,
y
,
0
,
sizeof
(
float
));
...
...
@@ -1055,6 +1060,41 @@ done:
value
,
expected_value
,
x
,
y
,
z
,
rb
->
sub_resource_idx
);
}
#define check_readback_data_u24(a, b, c, d, e) check_readback_data_u24_(__LINE__, a, b, c, d, e)
static
void
check_readback_data_u24_
(
unsigned
int
line
,
struct
resource_readback
*
rb
,
const
RECT
*
rect
,
unsigned
int
shift
,
DWORD
expected_value
,
BYTE
max_diff
)
{
unsigned
int
x
=
0
,
y
=
0
,
z
=
0
;
BOOL
all_match
=
FALSE
;
RECT
default_rect
;
DWORD
value
=
0
;
if
(
!
rect
)
{
SetRect
(
&
default_rect
,
0
,
0
,
rb
->
width
,
rb
->
height
);
rect
=
&
default_rect
;
}
for
(
z
=
0
;
z
<
rb
->
depth
;
++
z
)
{
for
(
y
=
rect
->
top
;
y
<
rect
->
bottom
;
++
y
)
{
for
(
x
=
rect
->
left
;
x
<
rect
->
right
;
++
x
)
{
value
=
get_readback_u32
(
rb
,
x
,
y
,
z
)
>>
shift
;
if
(
abs
((
int
)
value
-
(
int
)
expected_value
)
>
max_diff
)
goto
done
;
}
}
}
all_match
=
TRUE
;
done:
ok_
(
__FILE__
,
line
)(
all_match
,
"Got 0x%06x, expected 0x%06x at (%u, %u, %u), sub-resource %u.
\n
"
,
value
,
expected_value
,
x
,
y
,
z
,
rb
->
sub_resource_idx
);
}
#define check_readback_data_color(a, b, c, d) check_readback_data_color_(__LINE__, a, b, c, d)
static
void
check_readback_data_color_
(
unsigned
int
line
,
struct
resource_readback
*
rb
,
const
RECT
*
rect
,
DWORD
expected_color
,
BYTE
max_diff
)
...
...
@@ -25446,10 +25486,10 @@ static void test_depth_bias(void)
struct
resource_readback
rb
;
ID3D11DepthStencilView
*
dsv
;
unsigned
int
expected_value
;
unsigned
int
x
,
y
,
i
,
j
,
k
;
ID3D11RasterizerState
*
rs
;
ID3D11Texture2D
*
texture
;
unsigned
int
format_idx
;
unsigned
int
y
,
i
,
j
,
k
;
unsigned
int
shift
=
0
;
ID3D11Device
*
device
;
float
*
depth_values
;
...
...
@@ -25590,19 +25630,7 @@ static void test_depth_bias(void)
depth
=
min
(
max
(
0
.
0
f
,
quads
[
i
].
z
+
bias
),
1
.
0
f
);
get_texture_readback
(
texture
,
0
,
&
rb
);
for
(
y
=
0
;
y
<
texture_desc
.
Height
;
++
y
)
{
expected_value
=
depth
*
16777215
.
0
f
+
0
.
5
f
;
for
(
x
=
0
;
x
<
texture_desc
.
Width
;
++
x
)
{
u32
=
get_readback_data
(
&
rb
,
x
,
y
,
0
,
sizeof
(
*
u32
));
u32_value
=
*
u32
>>
shift
;
ok
(
abs
(
u32_value
-
expected_value
)
<=
1
,
"Got value %#x (%.8e), expected %#x (%.8e).
\n
"
,
u32_value
,
u32_value
/
16777215
.
0
f
,
expected_value
,
expected_value
/
16777215
.
0
f
);
}
}
check_readback_data_u24
(
&
rb
,
NULL
,
shift
,
depth
*
16777215
.
0
f
+
0
.
5
f
,
1
);
release_resource_readback
(
&
rb
);
break
;
case
DXGI_FORMAT_D16_UNORM
:
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