Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
9af58dc1
Commit
9af58dc1
authored
9 years ago
by
Józef Kucia
Committed by
Alexandre Julliard
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d11/tests: Add test for device interfaces.
parent
40c5303b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/d3d11/tests/Makefile.in
+5
-0
5 additions, 0 deletions
dlls/d3d11/tests/Makefile.in
dlls/d3d11/tests/d3d11.c
+100
-0
100 additions, 0 deletions
dlls/d3d11/tests/d3d11.c
with
107 additions
and
0 deletions
configure
+
1
−
0
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
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
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])
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d11/tests/Makefile.in
0 → 100644
+
5
−
0
View file @
9af58dc1
TESTDLL
=
d3d11.dll
IMPORTS
=
d3d11
C_SRCS
=
\
d3d11.c
This diff is collapsed.
Click to expand it.
dlls/d3d11/tests/d3d11.c
0 → 100644
+
100
−
0
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
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment