Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ef88037b
Commit
ef88037b
authored
May 23, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
May 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d12: Implement D3D12CreateDevice().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
803fa962
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
2 deletions
+93
-2
Makefile.in
dlls/d3d12/Makefile.in
+1
-0
d3d12_main.c
dlls/d3d12/d3d12_main.c
+92
-2
No files found.
dlls/d3d12/Makefile.in
View file @
ef88037b
MODULE
=
d3d12.dll
IMPORTLIB
=
d3d12
IMPORTS
=
gdi32 user32
EXTRALIBS
=
$(VKD3D_LIBS)
EXTRAINCL
=
$(VKD3D_CFLAGS)
...
...
dlls/d3d12/d3d12_main.c
View file @
ef88037b
...
...
@@ -26,7 +26,9 @@
#define WINE_VK_ALIGN(x)
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/vulkan.h"
#include "wine/vulkan_driver.h"
#include "d3d12.h"
...
...
@@ -41,13 +43,101 @@ HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug)
return
E_NOTIMPL
;
}
static
HRESULT
d3d12_signal_event
(
HANDLE
event
)
{
return
SetEvent
(
event
)
?
S_OK
:
E_FAIL
;
}
struct
d3d12_thread_data
{
PFN_vkd3d_thread
main_pfn
;
void
*
data
;
};
static
DWORD
WINAPI
d3d12_thread_main
(
void
*
data
)
{
struct
d3d12_thread_data
*
thread_data
=
data
;
thread_data
->
main_pfn
(
thread_data
->
data
);
heap_free
(
thread_data
);
return
0
;
}
static
void
*
d3d12_create_thread
(
PFN_vkd3d_thread
main_pfn
,
void
*
data
)
{
struct
d3d12_thread_data
*
thread_data
;
HANDLE
thread
;
if
(
!
(
thread_data
=
heap_alloc
(
sizeof
(
*
thread_data
))))
{
ERR
(
"Failed to allocate thread data.
\n
"
);
return
NULL
;
}
thread_data
->
main_pfn
=
main_pfn
;
thread_data
->
data
=
data
;
if
(
!
(
thread
=
CreateThread
(
NULL
,
0
,
d3d12_thread_main
,
thread_data
,
0
,
NULL
)))
heap_free
(
thread_data
);
return
thread
;
}
static
HRESULT
d3d12_join_thread
(
void
*
handle
)
{
HANDLE
thread
=
handle
;
DWORD
ret
;
if
((
ret
=
WaitForSingleObject
(
thread
,
INFINITE
))
!=
WAIT_OBJECT_0
)
ERR
(
"Failed to wait for thread, ret %#x.
\n
"
,
ret
);
CloseHandle
(
thread
);
return
ret
==
WAIT_OBJECT_0
?
S_OK
:
E_FAIL
;
}
static
const
struct
vulkan_funcs
*
get_vk_funcs
(
void
)
{
const
struct
vulkan_funcs
*
vk_funcs
;
HDC
hdc
;
hdc
=
GetDC
(
0
);
vk_funcs
=
__wine_get_vulkan_driver
(
hdc
,
WINE_VULKAN_DRIVER_VERSION
);
ReleaseDC
(
0
,
hdc
);
return
vk_funcs
;
}
HRESULT
WINAPI
D3D12CreateDevice
(
IUnknown
*
adapter
,
D3D_FEATURE_LEVEL
minimum_feature_level
,
REFIID
iid
,
void
**
device
)
{
FIXME
(
"adapter %p, minimum_feature_level %#x, iid %s, device %p stub!
\n
"
,
struct
vkd3d_instance_create_info
instance_create_info
;
struct
vkd3d_device_create_info
device_create_info
;
const
struct
vulkan_funcs
*
vk_funcs
;
TRACE
(
"adapter %p, minimum_feature_level %#x, iid %s, device %p.
\n
"
,
adapter
,
minimum_feature_level
,
debugstr_guid
(
iid
),
device
);
return
E_NOTIMPL
;
if
(
!
(
vk_funcs
=
get_vk_funcs
()))
{
ERR
(
"Failed to get Wine Vulkan driver.
\n
"
);
return
E_FAIL
;
}
FIXME
(
"Ignoring adapter %p.
\n
"
,
adapter
);
memset
(
&
instance_create_info
,
0
,
sizeof
(
instance_create_info
));
instance_create_info
.
type
=
VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
;
instance_create_info
.
pfn_signal_event
=
d3d12_signal_event
;
instance_create_info
.
pfn_create_thread
=
d3d12_create_thread
;
instance_create_info
.
pfn_join_thread
=
d3d12_join_thread
;
instance_create_info
.
wchar_size
=
sizeof
(
WCHAR
);
instance_create_info
.
pfn_vkGetInstanceProcAddr
=
(
PFN_vkGetInstanceProcAddr
)
vk_funcs
->
p_vkGetInstanceProcAddr
;
memset
(
&
device_create_info
,
0
,
sizeof
(
device_create_info
));
device_create_info
.
type
=
VKD3D_STRUCTURE_TYPE_DEVICE_CREATE_INFO
;
device_create_info
.
minimum_feature_level
=
minimum_feature_level
;
device_create_info
.
instance_create_info
=
&
instance_create_info
;
return
vkd3d_create_device
(
&
device_create_info
,
iid
,
device
);
}
HRESULT
WINAPI
D3D12CreateRootSignatureDeserializer
(
const
void
*
data
,
SIZE_T
data_size
,
...
...
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