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
b53d4dac
Commit
b53d4dac
authored
Mar 03, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d12: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5d62e560
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
90 deletions
+10
-90
Makefile.in
dlls/d3d12/Makefile.in
+2
-5
d3d12_main.c
dlls/d3d12/d3d12_main.c
+8
-85
No files found.
dlls/d3d12/Makefile.in
View file @
b53d4dac
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
MODULE
=
d3d12.dll
IMPORTLIB
=
d3d12
IMPORTS
=
dxgi dxguid gdi32 user32 uuid win32u
EXTRALIBS
=
$(VKD3D_LIBS)
EXTRAINCL
=
$(VKD3D_CFLAGS)
EXTRADLLFLAGS
=
-mcygwin
IMPORTS
=
dxgi dxguid wined3d gdi32 user32 uuid win32u
EXTRAINCL
=
$(VKD3D_PE_CFLAGS)
C_SRCS
=
\
d3d12_main.c
dlls/d3d12/d3d12_main.c
View file @
b53d4dac
...
...
@@ -17,35 +17,19 @@
*
*/
#include "config.h"
#define COBJMACROS
#define VK_NO_PROTOTYPES
#define VKD3D_NO_VULKAN_H
#define VKD3D_NO_WIN32_TYPES
#ifndef USE_WIN32_VULKAN
#define WINE_VK_HOST
#endif
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/vulkan.h"
#include "wine/vulkan_driver.h"
#include "dxgi1_6.h"
#include "d3d12.h"
#include <vkd3d.h>
#include "dxgi1_6.h"
#include "initguid.h"
#include "wine/wined3d.h"
#include "wine/winedxgi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d12
);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
#ifdef USE_WIN32_VULKAN
static
HMODULE
vulkan_module
;
/* FIXME: We should unload vulkan-1.dll. */
...
...
@@ -67,21 +51,6 @@ static PFN_vkGetInstanceProcAddr load_vulkan(void)
return
NULL
;
}
#else
static
PFN_vkGetInstanceProcAddr
load_vulkan
(
void
)
{
const
struct
vulkan_funcs
*
vk_funcs
;
vk_funcs
=
__wine_get_vulkan_driver
(
WINE_VULKAN_DRIVER_VERSION
);
if
(
vk_funcs
)
return
(
PFN_vkGetInstanceProcAddr
)
vk_funcs
->
p_vkGetInstanceProcAddr
;
return
NULL
;
}
#endif
/* USE_WIN32_VULKAN */
HRESULT
WINAPI
D3D12GetDebugInterface
(
REFIID
iid
,
void
**
debug
)
{
TRACE
(
"iid %s, debug %p.
\n
"
,
debugstr_guid
(
iid
),
debug
);
...
...
@@ -104,52 +73,6 @@ 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
HRESULT
d3d12_get_adapter
(
IWineDXGIAdapter
**
wine_adapter
,
IUnknown
*
adapter
)
{
IDXGIAdapter
*
dxgi_adapter
=
NULL
;
...
...
@@ -200,7 +123,7 @@ static BOOL check_vk_instance_extension(VkInstance vk_instance,
if
(
pfn_vkEnumerateInstanceExtensionProperties
(
NULL
,
&
count
,
NULL
)
<
0
)
return
FALSE
;
if
(
!
(
properties
=
heap_
calloc
(
count
,
sizeof
(
*
properties
))))
if
(
!
(
properties
=
calloc
(
count
,
sizeof
(
*
properties
))))
return
FALSE
;
if
(
pfn_vkEnumerateInstanceExtensionProperties
(
NULL
,
&
count
,
properties
)
>=
0
)
...
...
@@ -215,7 +138,7 @@ static BOOL check_vk_instance_extension(VkInstance vk_instance,
}
}
heap_
free
(
properties
);
free
(
properties
);
return
ret
;
}
...
...
@@ -254,7 +177,7 @@ static VkPhysicalDevice d3d12_get_vk_physical_device(struct vkd3d_instance *inst
return
VK_NULL_HANDLE
;
}
if
(
!
(
vk_physical_devices
=
heap_
calloc
(
count
,
sizeof
(
*
vk_physical_devices
))))
if
(
!
(
vk_physical_devices
=
calloc
(
count
,
sizeof
(
*
vk_physical_devices
))))
return
VK_NULL_HANDLE
;
if
((
vr
=
pfn_vkEnumeratePhysicalDevices
(
vk_instance
,
&
count
,
vk_physical_devices
))
<
0
)
...
...
@@ -305,7 +228,7 @@ static VkPhysicalDevice d3d12_get_vk_physical_device(struct vkd3d_instance *inst
FIXME
(
"Could not find Vulkan physical device for DXGI adapter.
\n
"
);
done:
heap_
free
(
vk_physical_devices
);
free
(
vk_physical_devices
);
return
vk_physical_device
;
}
...
...
@@ -367,8 +290,8 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_fe
instance_create_info
.
type
=
VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
;
instance_create_info
.
next
=
&
optional_extensions_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
.
pfn_create_thread
=
NULL
;
instance_create_info
.
pfn_join_thread
=
NULL
;
instance_create_info
.
wchar_size
=
sizeof
(
WCHAR
);
instance_create_info
.
pfn_vkGetInstanceProcAddr
=
pfn_vkGetInstanceProcAddr
;
instance_create_info
.
instance_extensions
=
instance_extensions
;
...
...
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