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
9af58dc1
Commit
9af58dc1
authored
Aug 24, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11/tests: Add test for device interfaces.
parent
40c5303b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
0 deletions
+107
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/d3d11/tests/Makefile.in
+5
-0
d3d11.c
dlls/d3d11/tests/d3d11.c
+100
-0
No files found.
configure
View file @
9af58dc1
...
...
@@ -17236,6 +17236,7 @@ wine_fn_config_dll d3d10_1 enable_d3d10_1 implib
wine_fn_config_dll d3d10core enable_d3d10core implib
wine_fn_config_test dlls/d3d10core/tests d3d10core_test
wine_fn_config_dll d3d11 enable_d3d11 implib
wine_fn_config_test dlls/d3d11/tests d3d11_test
wine_fn_config_dll d3d8 enable_d3d8 implib
wine_fn_config_test dlls/d3d8/tests d3d8_test
wine_fn_config_dll d3d9 enable_d3d9 implib
...
...
configure.ac
View file @
9af58dc1
...
...
@@ -2837,6 +2837,7 @@ WINE_CONFIG_DLL(d3d10_1,,[implib])
WINE_CONFIG_DLL(d3d10core,,[implib])
WINE_CONFIG_TEST(dlls/d3d10core/tests)
WINE_CONFIG_DLL(d3d11,,[implib])
WINE_CONFIG_TEST(dlls/d3d11/tests)
WINE_CONFIG_DLL(d3d8,,[implib])
WINE_CONFIG_TEST(dlls/d3d8/tests)
WINE_CONFIG_DLL(d3d9,,[implib])
...
...
dlls/d3d11/tests/Makefile.in
0 → 100644
View file @
9af58dc1
TESTDLL
=
d3d11.dll
IMPORTS
=
d3d11
C_SRCS
=
\
d3d11.c
dlls/d3d11/tests/d3d11.c
0 → 100644
View file @
9af58dc1
/*
* Copyright 2015 Józef Kucia for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "initguid.h"
#include "d3d11.h"
#include "wine/test.h"
static
ID3D11Device
*
create_device
(
D3D_FEATURE_LEVEL
feature_level
)
{
ID3D11Device
*
device
;
if
(
SUCCEEDED
(
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
&
feature_level
,
1
,
D3D11_SDK_VERSION
,
&
device
,
NULL
,
NULL
)))
return
device
;
if
(
SUCCEEDED
(
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_WARP
,
NULL
,
0
,
&
feature_level
,
1
,
D3D11_SDK_VERSION
,
&
device
,
NULL
,
NULL
)))
return
device
;
if
(
SUCCEEDED
(
D3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_REFERENCE
,
NULL
,
0
,
&
feature_level
,
1
,
D3D11_SDK_VERSION
,
&
device
,
NULL
,
NULL
)))
return
device
;
return
NULL
;
}
static
void
test_device_interfaces
(
void
)
{
static
const
D3D_FEATURE_LEVEL
feature_levels
[]
=
{
D3D_FEATURE_LEVEL_11_1
,
D3D_FEATURE_LEVEL_11_0
,
D3D_FEATURE_LEVEL_10_1
,
D3D_FEATURE_LEVEL_10_0
,
D3D_FEATURE_LEVEL_9_3
,
D3D_FEATURE_LEVEL_9_2
,
D3D_FEATURE_LEVEL_9_1
};
ID3D11Device
*
device
;
IUnknown
*
iface
;
ULONG
refcount
;
unsigned
int
i
;
HRESULT
hr
;
for
(
i
=
0
;
i
<
sizeof
(
feature_levels
)
/
sizeof
(
*
feature_levels
);
i
++
)
{
if
(
!
(
device
=
create_device
(
feature_levels
[
i
])))
{
skip
(
"Failed to create device for feature level %#x, skipping tests.
\n
"
,
feature_levels
[
i
]);
continue
;
}
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_IUnknown
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Device should implement IUnknown interface, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_IDXGIObject
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Device should implement IDXGIObject interface, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_IDXGIDevice
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
),
"Device should implement IDXGIDevice interface, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
iface
);
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_ID3D10Multithread
,
(
void
**
)
&
iface
);
ok
(
SUCCEEDED
(
hr
)
||
broken
(
hr
==
E_NOINTERFACE
)
/* Not available on all Windows versions. */
,
"Device should implement ID3D10Multithread interface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
iface
);
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_ID3D10Device
,
(
void
**
)
&
iface
);
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"Device should not implement ID3D10Device interface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
iface
);
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_ID3D10Device1
,
(
void
**
)
&
iface
);
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"Device should not implement ID3D10Device1 interface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
iface
);
refcount
=
ID3D11Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
}
START_TEST
(
d3d11
)
{
test_device_interfaces
();
}
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