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
bbdad747
Commit
bbdad747
authored
Nov 18, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Wrap VkDeviceMemory.
parent
60085e46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
3 deletions
+64
-3
make_vulkan
dlls/winevulkan/make_vulkan
+5
-0
vulkan.c
dlls/winevulkan/vulkan.c
+46
-3
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+10
-0
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+0
-0
vulkan_thunks.h
dlls/winevulkan/vulkan_thunks.h
+3
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
bbdad747
...
...
@@ -209,7 +209,10 @@ FUNCTION_OVERRIDES = {
"vkGetDeviceProcAddr"
:
{
"dispatch"
:
False
,
"driver"
:
True
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
NONE
},
"vkGetDeviceQueue"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkGetDeviceQueue2"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkAllocateMemory"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
"vkFreeMemory"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
"vkMapMemory"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
"vkUnmapMemory"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
# VK_KHR_surface
"vkDestroySurfaceKHR"
:
{
"dispatch"
:
True
,
"driver"
:
True
,
"thunk"
:
ThunkType
.
NONE
},
...
...
@@ -1079,6 +1082,8 @@ class VkHandle(object):
return
"wine_device_from_handle({0})->device"
.
format
(
name
)
if
self
.
name
==
"VkInstance"
:
return
"wine_instance_from_handle({0})->instance"
.
format
(
name
)
if
self
.
name
==
"VkDeviceMemory"
:
return
"wine_device_memory_from_handle({0})->memory"
.
format
(
name
)
if
self
.
name
==
"VkPhysicalDevice"
:
return
"wine_phys_dev_from_handle({0})->phys_dev"
.
format
(
name
)
if
self
.
name
==
"VkQueue"
:
...
...
dlls/winevulkan/vulkan.c
View file @
bbdad747
...
...
@@ -1441,19 +1441,54 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface,
free
(
object
);
}
VkResult
wine_vkMapMemory
(
VkDevice
handle
,
VkDeviceMemory
memory
,
VkDeviceSize
offset
,
VkResult
wine_vkAllocateMemory
(
VkDevice
handle
,
const
VkMemoryAllocateInfo
*
alloc_info
,
const
VkAllocationCallbacks
*
allocator
,
VkDeviceMemory
*
ret
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
handle
);
struct
wine_device_memory
*
memory
;
VkResult
result
;
if
(
!
(
memory
=
malloc
(
sizeof
(
*
memory
))))
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
result
=
device
->
funcs
.
p_vkAllocateMemory
(
device
->
device
,
alloc_info
,
NULL
,
&
memory
->
memory
);
if
(
result
!=
VK_SUCCESS
)
{
free
(
memory
);
return
result
;
}
*
ret
=
(
VkDeviceMemory
)(
uintptr_t
)
memory
;
return
VK_SUCCESS
;
}
void
wine_vkFreeMemory
(
VkDevice
handle
,
VkDeviceMemory
memory_handle
,
const
VkAllocationCallbacks
*
allocator
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
handle
);
struct
wine_device_memory
*
memory
;
if
(
!
memory_handle
)
return
;
memory
=
wine_device_memory_from_handle
(
memory_handle
);
device
->
funcs
.
p_vkFreeMemory
(
device
->
device
,
memory
->
memory
,
NULL
);
free
(
memory
);
}
VkResult
wine_vkMapMemory
(
VkDevice
handle
,
VkDeviceMemory
memory_handle
,
VkDeviceSize
offset
,
VkDeviceSize
size
,
VkMemoryMapFlags
flags
,
void
**
data
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
handle
);
struct
wine_device_memory
*
memory
=
wine_device_memory_from_handle
(
memory_handle
);
VkResult
result
;
result
=
device
->
funcs
.
p_vkMapMemory
(
device
->
device
,
memory
,
offset
,
size
,
flags
,
data
);
result
=
device
->
funcs
.
p_vkMapMemory
(
device
->
device
,
memory
->
memory
,
offset
,
size
,
flags
,
data
);
#ifdef _WIN64
if
(
NtCurrentTeb
()
->
WowTebOffset
&&
result
==
VK_SUCCESS
&&
(
UINT_PTR
)
*
data
>>
32
)
{
FIXME
(
"returned mapping %p does not fit 32-bit pointer
\n
"
,
*
data
);
device
->
funcs
.
p_vkUnmapMemory
(
device
->
device
,
memory
);
device
->
funcs
.
p_vkUnmapMemory
(
device
->
device
,
memory
->
memory
);
*
data
=
NULL
;
result
=
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
...
...
@@ -1462,6 +1497,14 @@ VkResult wine_vkMapMemory(VkDevice handle, VkDeviceMemory memory, VkDeviceSize o
return
result
;
}
void
wine_vkUnmapMemory
(
VkDevice
handle
,
VkDeviceMemory
memory_handle
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
handle
);
struct
wine_device_memory
*
memory
=
wine_device_memory_from_handle
(
memory_handle
);
device
->
funcs
.
p_vkUnmapMemory
(
device
->
device
,
memory
->
memory
);
}
static
inline
void
adjust_max_image_count
(
struct
wine_phys_dev
*
phys_dev
,
VkSurfaceCapabilitiesKHR
*
capabilities
)
{
/* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile
...
...
dlls/winevulkan/vulkan_private.h
View file @
bbdad747
...
...
@@ -169,6 +169,16 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand
return
(
struct
wine_cmd_pool
*
)(
uintptr_t
)
client_ptr
->
unix_handle
;
}
struct
wine_device_memory
{
VkDeviceMemory
memory
;
};
static
inline
struct
wine_device_memory
*
wine_device_memory_from_handle
(
VkDeviceMemory
handle
)
{
return
(
struct
wine_device_memory
*
)(
uintptr_t
)
handle
;
}
struct
wine_debug_utils_messenger
{
struct
wine_instance
*
instance
;
/* parent */
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
bbdad747
This diff is collapsed.
Click to expand it.
dlls/winevulkan/vulkan_thunks.h
View file @
bbdad747
...
...
@@ -16,6 +16,7 @@
/* Functions for which we have custom implementations outside of the thunks. */
VkResult
wine_vkAllocateCommandBuffers
(
VkDevice
device
,
const
VkCommandBufferAllocateInfo
*
pAllocateInfo
,
VkCommandBuffer
*
pCommandBuffers
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkAllocateMemory
(
VkDevice
device
,
const
VkMemoryAllocateInfo
*
pAllocateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkDeviceMemory
*
pMemory
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkCreateCommandPool
(
VkDevice
device
,
const
VkCommandPoolCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkCommandPool
*
pCommandPool
,
void
*
client_ptr
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkCreateDebugReportCallbackEXT
(
VkInstance
instance
,
const
VkDebugReportCallbackCreateInfoEXT
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkDebugReportCallbackEXT
*
pCallback
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkCreateDebugUtilsMessengerEXT
(
VkInstance
instance
,
const
VkDebugUtilsMessengerCreateInfoEXT
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkDebugUtilsMessengerEXT
*
pMessenger
)
DECLSPEC_HIDDEN
;
...
...
@@ -36,6 +37,7 @@ VkResult wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPh
VkResult
wine_vkEnumeratePhysicalDeviceGroupsKHR
(
VkInstance
instance
,
uint32_t
*
pPhysicalDeviceGroupCount
,
VkPhysicalDeviceGroupProperties
*
pPhysicalDeviceGroupProperties
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkEnumeratePhysicalDevices
(
VkInstance
instance
,
uint32_t
*
pPhysicalDeviceCount
,
VkPhysicalDevice
*
pPhysicalDevices
)
DECLSPEC_HIDDEN
;
void
wine_vkFreeCommandBuffers
(
VkDevice
device
,
VkCommandPool
commandPool
,
uint32_t
commandBufferCount
,
const
VkCommandBuffer
*
pCommandBuffers
)
DECLSPEC_HIDDEN
;
void
wine_vkFreeMemory
(
VkDevice
device
,
VkDeviceMemory
memory
,
const
VkAllocationCallbacks
*
pAllocator
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkGetCalibratedTimestampsEXT
(
VkDevice
device
,
uint32_t
timestampCount
,
const
VkCalibratedTimestampInfoEXT
*
pTimestampInfos
,
uint64_t
*
pTimestamps
,
uint64_t
*
pMaxDeviation
)
DECLSPEC_HIDDEN
;
void
wine_vkGetDeviceQueue
(
VkDevice
device
,
uint32_t
queueFamilyIndex
,
uint32_t
queueIndex
,
VkQueue
*
pQueue
)
DECLSPEC_HIDDEN
;
void
wine_vkGetDeviceQueue2
(
VkDevice
device
,
const
VkDeviceQueueInfo2
*
pQueueInfo
,
VkQueue
*
pQueue
)
DECLSPEC_HIDDEN
;
...
...
@@ -51,6 +53,7 @@ VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice phys
VkResult
wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR
(
VkPhysicalDevice
physicalDevice
,
const
VkPhysicalDeviceSurfaceInfo2KHR
*
pSurfaceInfo
,
VkSurfaceCapabilities2KHR
*
pSurfaceCapabilities
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
(
VkPhysicalDevice
physicalDevice
,
VkSurfaceKHR
surface
,
VkSurfaceCapabilitiesKHR
*
pSurfaceCapabilities
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkMapMemory
(
VkDevice
device
,
VkDeviceMemory
memory
,
VkDeviceSize
offset
,
VkDeviceSize
size
,
VkMemoryMapFlags
flags
,
void
**
ppData
)
DECLSPEC_HIDDEN
;
void
wine_vkUnmapMemory
(
VkDevice
device
,
VkDeviceMemory
memory
)
DECLSPEC_HIDDEN
;
/* For use by vkDevice and children */
struct
vulkan_device_funcs
...
...
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