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
19326ff9
Commit
19326ff9
authored
Sep 05, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Wrap VkCommandPool on PE side.
parent
ab747c6e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
34 deletions
+61
-34
loader.c
dlls/winevulkan/loader.c
+34
-0
loader_thunks.c
dlls/winevulkan/loader_thunks.c
+0
-19
loader_thunks.h
dlls/winevulkan/loader_thunks.h
+1
-0
make_vulkan
dlls/winevulkan/make_vulkan
+2
-2
vulkan.c
dlls/winevulkan/vulkan.c
+11
-7
vulkan_loader.h
dlls/winevulkan/vulkan_loader.h
+10
-0
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+3
-6
No files found.
dlls/winevulkan/loader.c
View file @
19326ff9
...
...
@@ -491,6 +491,40 @@ void WINAPI vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *alloca
free
(
device
);
}
VkResult
WINAPI
vkCreateCommandPool
(
VkDevice
device
,
const
VkCommandPoolCreateInfo
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkCommandPool
*
ret
)
{
struct
vkCreateCommandPool_params
params
;
struct
vk_command_pool
*
cmd_pool
;
VkResult
result
;
if
(
!
(
cmd_pool
=
malloc
(
sizeof
(
*
cmd_pool
))))
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
cmd_pool
->
unix_handle
=
0
;
params
.
device
=
device
;
params
.
pCreateInfo
=
create_info
;
params
.
pAllocator
=
allocator
;
params
.
pCommandPool
=
ret
;
params
.
client_ptr
=
cmd_pool
;
result
=
vk_unix_call
(
unix_vkCreateCommandPool
,
&
params
);
if
(
!
cmd_pool
->
unix_handle
)
free
(
cmd_pool
);
return
result
;
}
void
WINAPI
vkDestroyCommandPool
(
VkDevice
device
,
VkCommandPool
handle
,
const
VkAllocationCallbacks
*
allocator
)
{
struct
vk_command_pool
*
cmd_pool
=
command_pool_from_handle
(
handle
);
struct
vkDestroyCommandPool_params
params
;
params
.
device
=
device
;
params
.
commandPool
=
handle
;
params
.
pAllocator
=
allocator
;
vk_unix_call
(
unix_vkDestroyCommandPool
,
&
params
);
free
(
cmd_pool
);
}
static
BOOL
WINAPI
call_vulkan_debug_report_callback
(
struct
wine_vk_debug_report_params
*
params
,
ULONG
size
)
{
return
params
->
user_callback
(
params
->
flags
,
params
->
object_type
,
params
->
object_handle
,
params
->
location
,
...
...
dlls/winevulkan/loader_thunks.c
View file @
19326ff9
...
...
@@ -1999,16 +1999,6 @@ VkResult WINAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo
return
vk_unix_call
(
unix_vkCreateBufferView
,
&
params
);
}
VkResult
WINAPI
vkCreateCommandPool
(
VkDevice
device
,
const
VkCommandPoolCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkCommandPool
*
pCommandPool
)
{
struct
vkCreateCommandPool_params
params
;
params
.
device
=
device
;
params
.
pCreateInfo
=
pCreateInfo
;
params
.
pAllocator
=
pAllocator
;
params
.
pCommandPool
=
pCommandPool
;
return
vk_unix_call
(
unix_vkCreateCommandPool
,
&
params
);
}
VkResult
WINAPI
vkCreateComputePipelines
(
VkDevice
device
,
VkPipelineCache
pipelineCache
,
uint32_t
createInfoCount
,
const
VkComputePipelineCreateInfo
*
pCreateInfos
,
const
VkAllocationCallbacks
*
pAllocator
,
VkPipeline
*
pPipelines
)
{
struct
vkCreateComputePipelines_params
params
;
...
...
@@ -2441,15 +2431,6 @@ void WINAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const
vk_unix_call
(
unix_vkDestroyBufferView
,
&
params
);
}
void
WINAPI
vkDestroyCommandPool
(
VkDevice
device
,
VkCommandPool
commandPool
,
const
VkAllocationCallbacks
*
pAllocator
)
{
struct
vkDestroyCommandPool_params
params
;
params
.
device
=
device
;
params
.
commandPool
=
commandPool
;
params
.
pAllocator
=
pAllocator
;
vk_unix_call
(
unix_vkDestroyCommandPool
,
&
params
);
}
void
WINAPI
vkDestroyCuFunctionNVX
(
VkDevice
device
,
VkCuFunctionNVX
function
,
const
VkAllocationCallbacks
*
pAllocator
)
{
struct
vkDestroyCuFunctionNVX_params
params
;
...
...
dlls/winevulkan/loader_thunks.h
View file @
19326ff9
...
...
@@ -2066,6 +2066,7 @@ struct vkCreateCommandPool_params
const
VkCommandPoolCreateInfo
*
pCreateInfo
;
const
VkAllocationCallbacks
*
pAllocator
;
VkCommandPool
*
pCommandPool
;
void
*
client_ptr
;
};
struct
vkCreateComputePipelines_params
...
...
dlls/winevulkan/make_vulkan
View file @
19326ff9
...
...
@@ -201,10 +201,10 @@ FUNCTION_OVERRIDES = {
# Device functions
"vkAllocateCommandBuffers"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkCreateCommandPool"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkCreateCommandPool"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
PRIVATE
,
"extra_param"
:
"client_ptr"
},
"vkCreateComputePipelines"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
"vkCreateGraphicsPipelines"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
"vkDestroyCommandPool"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkDestroyCommandPool"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
PRIVATE
},
"vkDestroyDevice"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
PRIVATE
},
"vkFreeCommandBuffers"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkGetDeviceProcAddr"
:
{
"dispatch"
:
False
,
"driver"
:
True
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
NONE
},
...
...
dlls/winevulkan/vulkan.c
View file @
19326ff9
...
...
@@ -63,8 +63,8 @@ static const struct vulkan_funcs *vk_funcs;
#define WINE_VK_ADD_DISPATCHABLE_MAPPING(instance, client_handle, native_handle, object) \
wine_vk_add_handle_mapping((instance), (uintptr_t)(client_handle), (uintptr_t)(native_handle), &(object)->mapping)
#define WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance,
object, native_handle
) \
wine_vk_add_handle_mapping((instance), (uint
64_t) (uintptr_t) (object), (uint64_t)
(native_handle), &(object)->mapping)
#define WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(instance,
client_handle, native_handle, object
) \
wine_vk_add_handle_mapping((instance), (uint
ptr_t)(client_handle),
(native_handle), &(object)->mapping)
static
void
wine_vk_add_handle_mapping
(
struct
wine_instance
*
instance
,
uint64_t
wrapped_handle
,
uint64_t
native_handle
,
struct
wine_vk_mapping
*
mapping
)
{
...
...
@@ -1148,6 +1148,7 @@ NTSTATUS wine_vkCreateCommandPool(void *args)
const
VkCommandPoolCreateInfo
*
info
=
params
->
pCreateInfo
;
const
VkAllocationCallbacks
*
allocator
=
params
->
pAllocator
;
VkCommandPool
*
command_pool
=
params
->
pCommandPool
;
struct
vk_command_pool
*
handle
=
params
->
client_ptr
;
struct
wine_cmd_pool
*
object
;
VkResult
res
;
...
...
@@ -1165,8 +1166,11 @@ NTSTATUS wine_vkCreateCommandPool(void *args)
if
(
res
==
VK_SUCCESS
)
{
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
device
->
phys_dev
->
instance
,
object
,
object
->
command_pool
);
*
command_pool
=
wine_cmd_pool_to_handle
(
object
);
object
->
handle
=
(
uintptr_t
)
handle
;
handle
->
unix_handle
=
(
uintptr_t
)
object
;
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
device
->
phys_dev
->
instance
,
object
->
handle
,
object
->
command_pool
,
object
);
*
command_pool
=
object
->
handle
;
}
else
{
...
...
@@ -1575,7 +1579,7 @@ NTSTATUS wine_vkCreateWin32SurfaceKHR(void *args)
object
->
surface
=
vk_funcs
->
p_wine_get_native_surface
(
object
->
driver_surface
);
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
surface
);
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
surface
,
object
);
*
surface
=
wine_surface_to_handle
(
object
);
...
...
@@ -1689,7 +1693,7 @@ NTSTATUS wine_vkCreateDebugUtilsMessengerEXT(void *args)
return
res
;
}
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
debug_messenger
);
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
debug_messenger
,
object
);
*
messenger
=
wine_debug_utils_messenger_to_handle
(
object
);
return
VK_SUCCESS
;
...
...
@@ -1753,7 +1757,7 @@ NTSTATUS wine_vkCreateDebugReportCallbackEXT(void *args)
return
res
;
}
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
debug_callback
);
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
instance
,
object
,
object
->
debug_callback
,
object
);
*
callback
=
wine_debug_report_callback_to_handle
(
object
);
return
VK_SUCCESS
;
...
...
dlls/winevulkan/vulkan_loader.h
View file @
19326ff9
...
...
@@ -78,6 +78,16 @@ struct VkDevice_T
struct
VkQueue_T
queues
[
1
];
};
struct
vk_command_pool
{
UINT64
unix_handle
;
};
static
inline
struct
vk_command_pool
*
command_pool_from_handle
(
VkCommandPool
handle
)
{
return
(
struct
vk_command_pool
*
)(
uintptr_t
)
handle
;
}
struct
vulkan_func
{
const
char
*
name
;
...
...
dlls/winevulkan/vulkan_private.h
View file @
19326ff9
...
...
@@ -157,6 +157,7 @@ static inline struct wine_queue *wine_queue_from_handle(VkQueue handle)
struct
wine_cmd_pool
{
VkCommandPool
handle
;
VkCommandPool
command_pool
;
struct
list
command_buffers
;
...
...
@@ -166,12 +167,8 @@ struct wine_cmd_pool
static
inline
struct
wine_cmd_pool
*
wine_cmd_pool_from_handle
(
VkCommandPool
handle
)
{
return
(
struct
wine_cmd_pool
*
)(
uintptr_t
)
handle
;
}
static
inline
VkCommandPool
wine_cmd_pool_to_handle
(
struct
wine_cmd_pool
*
cmd_pool
)
{
return
(
VkCommandPool
)(
uintptr_t
)
cmd_pool
;
struct
vk_command_pool
*
client_ptr
=
command_pool_from_handle
(
handle
);
return
(
struct
wine_cmd_pool
*
)(
uintptr_t
)
client_ptr
->
unix_handle
;
}
struct
wine_debug_utils_messenger
...
...
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