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
74a2bd08
Commit
74a2bd08
authored
Apr 11, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Make the sanity test a normal test.
parent
9f6765f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
80 deletions
+60
-80
visual.c
dlls/d3d9/tests/visual.c
+60
-80
No files found.
dlls/d3d9/tests/visual.c
View file @
74a2bd08
...
...
@@ -192,44 +192,6 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d, HWND device_window, HWND
return
NULL
;
}
static
IDirect3DDevice9
*
init_d3d9
(
void
)
{
D3DADAPTER_IDENTIFIER9
identifier
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d9
;
HWND
window
;
HRESULT
hr
;
if
(
!
(
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
win_skip
(
"could not create D3D9
\n
"
);
return
NULL
;
}
memset
(
&
identifier
,
0
,
sizeof
(
identifier
));
hr
=
IDirect3D9_GetAdapterIdentifier
(
d3d9
,
0
,
0
,
&
identifier
);
ok
(
hr
==
D3D_OK
,
"Failed to get adapter identifier description
\n
"
);
trace
(
"Driver string:
\"
%s
\"\n
"
,
identifier
.
Driver
);
trace
(
"Description string:
\"
%s
\"\n
"
,
identifier
.
Description
);
/* Only Windows XP's default VGA driver should have an empty description */
ok
(
identifier
.
Description
[
0
]
!=
'\0'
||
broken
(
strcmp
(
identifier
.
Driver
,
"vga.dll"
)
==
0
),
"Empty driver description
\n
"
);
trace
(
"Device name string:
\"
%s
\"\n
"
,
identifier
.
DeviceName
);
ok
(
identifier
.
DeviceName
[
0
]
!=
'\0'
,
"Empty device name
\n
"
);
trace
(
"Driver version %d.%d.%d.%d
\n
"
,
HIWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
HIWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
));
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
if
((
device
=
create_device
(
d3d9
,
window
,
window
,
TRUE
)))
return
device
;
DestroyWindow
(
window
);
return
NULL
;
}
static
void
cleanup_device
(
IDirect3DDevice9
*
device
)
{
if
(
device
)
...
...
@@ -266,6 +228,48 @@ struct nvertex
DWORD
diffuse
;
};
static
void
test_sanity
(
void
)
{
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
D3DCOLOR
color
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
1
,
1
);
ok
(
color
==
0x00ff0000
,
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff00ddee
,
0
.
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
639
,
479
);
ok
(
color
==
0x0000ddee
,
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#x.
\n
"
,
hr
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
lighting_test
(
void
)
{
DWORD
nfvf
=
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
|
D3DFVF_NORMAL
;
...
...
@@ -16556,53 +16560,32 @@ static void add_dirty_rect_test(void)
START_TEST
(
visual
)
{
IDirect3DDevice9
*
device_pt
r
;
D3DCAPS9
caps
;
D3DADAPTER_IDENTIFIER9
identifie
r
;
IDirect3D9
*
d3d
;
HRESULT
hr
;
DWORD
color
;
if
(
!
(
d
evice_ptr
=
init_d3d9
(
)))
if
(
!
(
d
3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
skip
(
"
Creating the device failed
\n
"
);
skip
(
"
could not create D3D9 object
\n
"
);
return
;
}
IDirect3DDevice9_GetDeviceCaps
(
device_ptr
,
&
caps
);
/* Check for the reliability of the returned data */
hr
=
IDirect3DDevice9_Clear
(
device_ptr
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff0000
,
0
.
0
,
0
);
if
(
FAILED
(
hr
))
{
skip
(
"Clear failed, can't assure correctness of the test results, skipping
\n
"
);
goto
cleanup
;
}
color
=
getPixelColor
(
device_ptr
,
1
,
1
);
if
(
color
!=
0x00ff0000
)
{
skip
(
"Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests, skipping
\n
"
,
color
);
goto
cleanup
;
}
IDirect3DDevice9_Present
(
device_ptr
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Clear
(
device_ptr
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff00ddee
,
0
.
0
,
0
);
if
(
FAILED
(
hr
))
{
skip
(
"Clear failed, can't assure correctness of the test results, skipping
\n
"
);
goto
cleanup
;
}
color
=
getPixelColor
(
device_ptr
,
639
,
479
);
if
(
color
!=
0x0000ddee
)
{
skip
(
"Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests, skipping
\n
"
,
color
);
goto
cleanup
;
}
IDirect3DDevice9_Present
(
device_ptr
,
NULL
,
NULL
,
NULL
,
NULL
);
memset
(
&
identifier
,
0
,
sizeof
(
identifier
));
hr
=
IDirect3D9_GetAdapterIdentifier
(
d3d
,
0
,
0
,
&
identifier
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get adapter identifier, hr %#x.
\n
"
,
hr
);
trace
(
"Driver string:
\"
%s
\"\n
"
,
identifier
.
Driver
);
trace
(
"Description string:
\"
%s
\"\n
"
,
identifier
.
Description
);
/* Only Windows XP's default VGA driver should have an empty description */
ok
(
identifier
.
Description
[
0
]
||
broken
(
!
strcmp
(
identifier
.
Driver
,
"vga.dll"
)),
"Empty driver description.
\n
"
);
trace
(
"Device name string:
\"
%s
\"\n
"
,
identifier
.
DeviceName
);
ok
(
identifier
.
DeviceName
[
0
],
"Empty device name.
\n
"
);
trace
(
"Driver version %d.%d.%d.%d
\n
"
,
HIWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
HighPart
),
HIWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
),
LOWORD
(
U
(
identifier
.
DriverVersion
).
LowPart
));
cleanup_device
(
device_ptr
);
device_ptr
=
NULL
;
IDirect3D9_Release
(
d3d
);
test_sanity
();
depth_clamp_test
();
stretchrect_test
();
lighting_test
();
...
...
@@ -16681,7 +16664,4 @@ START_TEST(visual)
multisampled_depth_buffer_test
();
resz_test
();
stencil_cull_test
();
cleanup
:
cleanup_device
(
device_ptr
);
}
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