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
80ce3b31
Commit
80ce3b31
authored
Jan 27, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core/tests: Use D3D10CreateDevice() to create a device.
parent
2d06703d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
48 deletions
+9
-48
Makefile.in
dlls/d3d10core/tests/Makefile.in
+1
-1
device.c
dlls/d3d10core/tests/device.c
+8
-47
No files found.
dlls/d3d10core/tests/Makefile.in
View file @
80ce3b31
TESTDLL
=
d3d10core.dll
IMPORTS
=
d3d10
core dxgi
IMPORTS
=
d3d10
C_SRCS
=
\
device.c
dlls/d3d10core/tests/device.c
View file @
80ce3b31
...
...
@@ -21,57 +21,18 @@
#include "d3d10.h"
#include "wine/test.h"
HRESULT
WINAPI
D3D10CoreCreateDevice
(
IDXGIFactory
*
factory
,
IDXGIAdapter
*
adapter
,
UINT
flags
,
void
*
unknown0
,
ID3D10Device
**
device
);
static
ID3D10Device
*
create_device
(
void
)
{
IDXGIFactory
*
factory
=
NULL
;
IDXGIAdapter
*
adapter
=
NULL
;
ID3D10Device
*
device
=
NULL
;
HRESULT
hr
;
hr
=
CreateDXGIFactory
(
&
IID_IDXGIFactory
,
(
void
*
)
&
factory
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IDXGIFactory_EnumAdapters
(
factory
,
0
,
&
adapter
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
DXGI_ERROR_NOT_FOUND
,
/* Some VMware and VirtualBox */
"EnumAdapters failed, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3D10CoreCreateDevice
(
factory
,
adapter
,
0
,
NULL
,
&
device
);
}
if
(
FAILED
(
hr
))
{
HMODULE
d3d10ref
;
trace
(
"Failed to create a HW device, trying REF
\n
"
);
if
(
adapter
)
IDXGIAdapter_Release
(
adapter
);
adapter
=
NULL
;
d3d10ref
=
LoadLibraryA
(
"d3d10ref.dll"
);
if
(
!
d3d10ref
)
{
trace
(
"d3d10ref.dll not available, unable to create a REF device
\n
"
);
goto
cleanup
;
}
hr
=
IDXGIFactory_CreateSoftwareAdapter
(
factory
,
d3d10ref
,
&
adapter
);
FreeLibrary
(
d3d10ref
);
ok
(
SUCCEEDED
(
hr
),
"CreateSoftwareAdapter failed, hr %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
D3D10CoreCreateDevice
(
factory
,
adapter
,
0
,
NULL
,
&
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a REF device, hr %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
}
ID3D10Device
*
device
;
cleanup:
if
(
adapter
)
IDXGIAdapter_Release
(
adapter
);
if
(
factory
)
IDXGIFactory_Release
(
factory
);
if
(
SUCCEEDED
(
D3D10CreateDevice
(
NULL
,
D3D10_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
D3D10_SDK_VERSION
,
&
device
)))
return
device
;
if
(
SUCCEEDED
(
D3D10CreateDevice
(
NULL
,
D3D10_DRIVER_TYPE_WARP
,
NULL
,
0
,
D3D10_SDK_VERSION
,
&
device
)))
return
device
;
if
(
SUCCEEDED
(
D3D10CreateDevice
(
NULL
,
D3D10_DRIVER_TYPE_REFERENCE
,
NULL
,
0
,
D3D10_SDK_VERSION
,
&
device
)))
return
device
;
return
device
;
return
NULL
;
}
static
void
test_device_interfaces
(
void
)
...
...
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