Commit 288d2c2e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winevulkan: Use "host" more consistently instead of "native".

We often use "native" to talk about Windows "native" code, which is confusing here.
parent 0080205d
...@@ -844,7 +844,7 @@ class VkFunction(object): ...@@ -844,7 +844,7 @@ class VkFunction(object):
else: else:
func_prefix = "wine_" func_prefix = "wine_"
# Call the native Vulkan function. # Call the host Vulkan function.
if self.type == "void": if self.type == "void":
body += " {0}{1}({2});\n".format(func_prefix, self.name, params) body += " {0}{1}({2});\n".format(func_prefix, self.name, params)
else: else:
...@@ -1112,33 +1112,33 @@ class VkHandle(object): ...@@ -1112,33 +1112,33 @@ class VkHandle(object):
def is_required(self): def is_required(self):
return self.required return self.required
def native_handle(self, name): def host_handle(self, name):
""" Provide access to the native handle of a wrapped object. """ """ Provide access to the host handle of a wrapped object. """
if self.name == "VkCommandBuffer": if self.name == "VkCommandBuffer":
return "wine_cmd_buffer_from_handle({0})->command_buffer".format(name) return "wine_cmd_buffer_from_handle({0})->host_command_buffer".format(name)
if self.name == "VkCommandPool": if self.name == "VkCommandPool":
return "wine_cmd_pool_from_handle({0})->command_pool".format(name) return "wine_cmd_pool_from_handle({0})->host_command_pool".format(name)
if self.name == "VkDebugUtilsMessengerEXT": if self.name == "VkDebugUtilsMessengerEXT":
return "wine_debug_utils_messenger_from_handle({0})->debug_messenger".format(name) return "wine_debug_utils_messenger_from_handle({0})->host_debug_messenger".format(name)
if self.name == "VkDebugReportCallbackEXT": if self.name == "VkDebugReportCallbackEXT":
return "wine_debug_report_callback_from_handle({0})->debug_callback".format(name) return "wine_debug_report_callback_from_handle({0})->host_debug_callback".format(name)
if self.name == "VkDeferredOperationKHR": if self.name == "VkDeferredOperationKHR":
return "wine_deferred_operation_from_handle({0})->deferred_operation".format(name) return "wine_deferred_operation_from_handle({0})->host_deferred_operation".format(name)
if self.name == "VkDevice": if self.name == "VkDevice":
return "wine_device_from_handle({0})->device".format(name) return "wine_device_from_handle({0})->host_device".format(name)
if self.name == "VkInstance": if self.name == "VkInstance":
return "wine_instance_from_handle({0})->instance".format(name) return "wine_instance_from_handle({0})->host_instance".format(name)
if self.name == "VkDeviceMemory": if self.name == "VkDeviceMemory":
return "wine_device_memory_from_handle({0})->memory".format(name) return "wine_device_memory_from_handle({0})->host_memory".format(name)
if self.name == "VkPhysicalDevice": if self.name == "VkPhysicalDevice":
return "wine_phys_dev_from_handle({0})->phys_dev".format(name) return "wine_phys_dev_from_handle({0})->host_physical_device".format(name)
if self.name == "VkQueue": if self.name == "VkQueue":
return "wine_queue_from_handle({0})->queue".format(name) return "wine_queue_from_handle({0})->host_queue".format(name)
if self.name == "VkSurfaceKHR": if self.name == "VkSurfaceKHR":
return "wine_surface_from_handle({0})->surface".format(name) return "wine_surface_from_handle({0})->host_surface".format(name)
if self.is_dispatchable(): if self.is_dispatchable():
LOGGER.error("Unhandled native handle for: {0}".format(self.name)) LOGGER.error("Unhandled host handle for: {0}".format(self.name))
return None return None
def driver_handle(self, name): def driver_handle(self, name):
...@@ -1147,10 +1147,10 @@ class VkHandle(object): ...@@ -1147,10 +1147,10 @@ class VkHandle(object):
if self.name == "VkSurfaceKHR": if self.name == "VkSurfaceKHR":
return "wine_surface_from_handle({0})->driver_surface".format(name) return "wine_surface_from_handle({0})->driver_surface".format(name)
return self.native_handle(name) return self.host_handle(name)
def is_wrapped(self): def is_wrapped(self):
return self.native_handle("test") is not None return self.host_handle("test") is not None
def needs_unwrapping(self): def needs_unwrapping(self):
return self.is_wrapped() return self.is_wrapped()
...@@ -1916,7 +1916,7 @@ class VkParam(VkVariable): ...@@ -1916,7 +1916,7 @@ class VkParam(VkVariable):
params_prefix, self.object_type, self.name) params_prefix, self.object_type, self.name)
elif self.is_handle(): elif self.is_handle():
# We need to pass the native handle to the native Vulkan calls and # We need to pass the host handle to the host Vulkan calls and
# the wine driver's handle to calls which are wrapped by the driver. # the wine driver's handle to calls which are wrapped by the driver.
unwrap_handle = self.handle.driver_handle(p) unwrap_handle = self.handle.driver_handle(p)
if unwrap_handle: if unwrap_handle:
...@@ -2682,10 +2682,10 @@ class VkGenerator(object): ...@@ -2682,10 +2682,10 @@ class VkGenerator(object):
f.write(" case {}:\n".format(handle.object_type)) f.write(" case {}:\n".format(handle.object_type))
if handle.is_dispatchable(): if handle.is_dispatchable():
f.write(" return (uint64_t) (uintptr_t) ") f.write(" return (uint64_t) (uintptr_t) ")
f.write(handle.native_handle("(({}) (uintptr_t) handle)".format(handle.name))) f.write(handle.host_handle("(({}) (uintptr_t) handle)".format(handle.name)))
else: else:
f.write(" return (uint64_t) ") f.write(" return (uint64_t) ")
f.write(handle.native_handle("handle")) f.write(handle.host_handle("handle"))
f.write(";\n"); f.write(";\n");
f.write(" default:\n") f.write(" default:\n")
f.write(" return handle;\n") f.write(" return handle;\n")
...@@ -3126,7 +3126,7 @@ class VkGenerator(object): ...@@ -3126,7 +3126,7 @@ class VkGenerator(object):
f.write("\n") f.write("\n")
f.write(" /* winevulkan specific functions */\n") f.write(" /* winevulkan specific functions */\n")
f.write(" VkSurfaceKHR (*p_wine_get_native_surface)(VkSurfaceKHR);\n") f.write(" VkSurfaceKHR (*p_wine_get_host_surface)(VkSurfaceKHR);\n")
f.write("};\n\n") f.write("};\n\n")
f.write("static inline void *get_vulkan_driver_device_proc_addr(\n") f.write("static inline void *get_vulkan_driver_device_proc_addr(\n")
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
#include "vulkan_thunks.h" #include "vulkan_thunks.h"
/* Some extensions have callbacks for those we need to be able to /* Some extensions have callbacks for those we need to be able to
* get the wine wrapper for a native handle * get the wine wrapper for a host handle
*/ */
struct wine_vk_mapping struct wine_vk_mapping
{ {
struct list link; struct list link;
uint64_t native_handle; uint64_t host_handle;
uint64_t wine_wrapped_handle; uint64_t wine_wrapped_handle;
}; };
...@@ -43,7 +43,7 @@ struct wine_cmd_buffer ...@@ -43,7 +43,7 @@ struct wine_cmd_buffer
struct wine_device *device; /* parent */ struct wine_device *device; /* parent */
VkCommandBuffer handle; /* client command buffer */ VkCommandBuffer handle; /* client command buffer */
VkCommandBuffer command_buffer; /* native command buffer */ VkCommandBuffer host_command_buffer;
struct wine_vk_mapping mapping; struct wine_vk_mapping mapping;
}; };
...@@ -59,7 +59,7 @@ struct wine_device ...@@ -59,7 +59,7 @@ struct wine_device
struct wine_phys_dev *phys_dev; /* parent */ struct wine_phys_dev *phys_dev; /* parent */
VkDevice handle; /* client device */ VkDevice handle; /* client device */
VkDevice device; /* native device */ VkDevice host_device;
struct wine_queue *queues; struct wine_queue *queues;
uint32_t queue_count; uint32_t queue_count;
...@@ -77,7 +77,7 @@ struct wine_debug_utils_messenger; ...@@ -77,7 +77,7 @@ struct wine_debug_utils_messenger;
struct wine_debug_report_callback struct wine_debug_report_callback
{ {
struct wine_instance *instance; /* parent */ struct wine_instance *instance; /* parent */
VkDebugReportCallbackEXT debug_callback; /* native callback object */ VkDebugReportCallbackEXT host_debug_callback;
/* application callback + data */ /* application callback + data */
PFN_vkDebugReportCallbackEXT user_callback; PFN_vkDebugReportCallbackEXT user_callback;
...@@ -91,7 +91,7 @@ struct wine_instance ...@@ -91,7 +91,7 @@ struct wine_instance
struct vulkan_instance_funcs funcs; struct vulkan_instance_funcs funcs;
VkInstance handle; /* client instance */ VkInstance handle; /* client instance */
VkInstance instance; /* native instance */ VkInstance host_instance;
/* We cache devices as we need to wrap them as they are /* We cache devices as we need to wrap them as they are
* dispatchable objects. * dispatchable objects.
...@@ -123,7 +123,7 @@ struct wine_phys_dev ...@@ -123,7 +123,7 @@ struct wine_phys_dev
struct wine_instance *instance; /* parent */ struct wine_instance *instance; /* parent */
VkPhysicalDevice handle; /* client physical device */ VkPhysicalDevice handle; /* client physical device */
VkPhysicalDevice phys_dev; /* native physical device */ VkPhysicalDevice host_physical_device;
VkPhysicalDeviceMemoryProperties memory_properties; VkPhysicalDeviceMemoryProperties memory_properties;
VkExtensionProperties *extensions; VkExtensionProperties *extensions;
...@@ -144,7 +144,7 @@ struct wine_queue ...@@ -144,7 +144,7 @@ struct wine_queue
struct wine_device *device; /* parent */ struct wine_device *device; /* parent */
VkQueue handle; /* client queue */ VkQueue handle; /* client queue */
VkQueue queue; /* native queue */ VkQueue host_queue;
uint32_t family_index; uint32_t family_index;
uint32_t queue_index; uint32_t queue_index;
...@@ -161,7 +161,7 @@ static inline struct wine_queue *wine_queue_from_handle(VkQueue handle) ...@@ -161,7 +161,7 @@ static inline struct wine_queue *wine_queue_from_handle(VkQueue handle)
struct wine_cmd_pool struct wine_cmd_pool
{ {
VkCommandPool handle; VkCommandPool handle;
VkCommandPool command_pool; VkCommandPool host_command_pool;
struct wine_vk_mapping mapping; struct wine_vk_mapping mapping;
}; };
...@@ -174,7 +174,7 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand ...@@ -174,7 +174,7 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand
struct wine_device_memory struct wine_device_memory
{ {
VkDeviceMemory memory; VkDeviceMemory host_memory;
void *mapping; void *mapping;
}; };
...@@ -186,7 +186,7 @@ static inline struct wine_device_memory *wine_device_memory_from_handle(VkDevice ...@@ -186,7 +186,7 @@ static inline struct wine_device_memory *wine_device_memory_from_handle(VkDevice
struct wine_debug_utils_messenger struct wine_debug_utils_messenger
{ {
struct wine_instance *instance; /* parent */ struct wine_instance *instance; /* parent */
VkDebugUtilsMessengerEXT debug_messenger; /* native messenger */ VkDebugUtilsMessengerEXT host_debug_messenger;
/* application callback + data */ /* application callback + data */
PFN_vkDebugUtilsMessengerCallbackEXT user_callback; PFN_vkDebugUtilsMessengerCallbackEXT user_callback;
...@@ -221,7 +221,7 @@ static inline VkDebugReportCallbackEXT wine_debug_report_callback_to_handle( ...@@ -221,7 +221,7 @@ static inline VkDebugReportCallbackEXT wine_debug_report_callback_to_handle(
struct wine_surface struct wine_surface
{ {
VkSurfaceKHR surface; /* native surface */ VkSurfaceKHR host_surface;
VkSurfaceKHR driver_surface; /* wine driver surface */ VkSurfaceKHR driver_surface; /* wine driver surface */
struct wine_vk_mapping mapping; struct wine_vk_mapping mapping;
...@@ -289,10 +289,8 @@ static inline void *conversion_context_alloc(struct conversion_context *pool, si ...@@ -289,10 +289,8 @@ static inline void *conversion_context_alloc(struct conversion_context *pool, si
struct wine_deferred_operation struct wine_deferred_operation
{ {
VkDeferredOperationKHR deferred_operation; /* native handle */ VkDeferredOperationKHR host_deferred_operation;
struct conversion_context ctx; /* to keep params alive. */ struct conversion_context ctx; /* to keep params alive. */
struct wine_vk_mapping mapping; struct wine_vk_mapping mapping;
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -849,7 +849,7 @@ static const struct vulkan_funcs vulkan_funcs = ...@@ -849,7 +849,7 @@ static const struct vulkan_funcs vulkan_funcs =
.p_vkGetPhysicalDeviceWin32PresentationSupportKHR = wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR,
.p_vkGetSwapchainImagesKHR = wayland_vkGetSwapchainImagesKHR, .p_vkGetSwapchainImagesKHR = wayland_vkGetSwapchainImagesKHR,
.p_vkQueuePresentKHR = wayland_vkQueuePresentKHR, .p_vkQueuePresentKHR = wayland_vkQueuePresentKHR,
.p_wine_get_native_surface = wayland_wine_get_native_surface, .p_wine_get_host_surface = wayland_wine_get_native_surface,
}; };
/********************************************************************** /**********************************************************************
......
...@@ -43,7 +43,7 @@ struct vulkan_funcs ...@@ -43,7 +43,7 @@ struct vulkan_funcs
VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *);
/* winevulkan specific functions */ /* winevulkan specific functions */
VkSurfaceKHR (*p_wine_get_native_surface)(VkSurfaceKHR); VkSurfaceKHR (*p_wine_get_host_surface)(VkSurfaceKHR);
}; };
static inline void *get_vulkan_driver_device_proc_addr( static inline void *get_vulkan_driver_device_proc_addr(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment