vulkan-1: Add initial implementation.

Signed-off-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Roderick Colenbrander 2018-03-28 00:20:50 -07:00 committed by Alexandre Julliard
parent dea298413e
commit f0f232ebd1
7 changed files with 299 additions and 3 deletions

2
configure vendored
View File

@ -1549,6 +1549,7 @@ enable_vdmdbg
enable_version
enable_virtdisk
enable_vssapi
enable_vulkan_1
enable_wbemdisp
enable_wbemprox
enable_wdscore
@ -19068,6 +19069,7 @@ wine_fn_config_makefile dlls/vnbt.vxd enable_win16
wine_fn_config_makefile dlls/vnetbios.vxd enable_win16
wine_fn_config_makefile dlls/vssapi enable_vssapi
wine_fn_config_makefile dlls/vtdapi.vxd enable_win16
wine_fn_config_makefile dlls/vulkan-1 enable_vulkan_1
wine_fn_config_makefile dlls/vwin32.vxd enable_win16
wine_fn_config_makefile dlls/w32skrnl enable_win16
wine_fn_config_makefile dlls/w32sys.dll16 enable_win16

View File

@ -3692,6 +3692,7 @@ WINE_CONFIG_MAKEFILE(dlls/vnbt.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/vnetbios.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/vssapi)
WINE_CONFIG_MAKEFILE(dlls/vtdapi.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/vulkan-1)
WINE_CONFIG_MAKEFILE(dlls/vwin32.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/w32skrnl,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/w32sys.dll16,enable_win16)

View File

@ -0,0 +1,7 @@
MODULE = vulkan-1.dll
IMPORTS = winevulkan
C_SRCS = \
vulkan.c
RC_SRCS = version.rc

27
dlls/vulkan-1/version.rc Normal file
View File

@ -0,0 +1,27 @@
/*
* Copyright 2018 Roderick Colenbrander
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h" /* Needed to get PACKAGE_VERSION */
#define WINE_FILEDESCRIPTION_STR "Wine Vulkan Loader"
#define WINE_FILENAME_STR "vulkan-1.dll"
#define WINE_FILEVERSION_STR PACKAGE_VERSION
#define WINE_PRODUCTVERSION_STR PACKAGE_VERSION
#define WINE_PRODUCTNAME_STR "Wine Vulkan"
#include "wine/wine_common_ver.rc"

159
dlls/vulkan-1/vulkan-1.spec Normal file
View File

@ -0,0 +1,159 @@
# Automatically generated from Vulkan vk.xml; DO NOT EDIT!
@ stdcall vkAcquireNextImageKHR(ptr int64 int64 int64 int64 ptr) winevulkan.wine_vkAcquireNextImageKHR
@ stdcall vkAllocateCommandBuffers(ptr ptr ptr) winevulkan.wine_vkAllocateCommandBuffers
@ stdcall vkAllocateDescriptorSets(ptr ptr ptr) winevulkan.wine_vkAllocateDescriptorSets
@ stdcall vkAllocateMemory(ptr ptr ptr ptr) winevulkan.wine_vkAllocateMemory
@ stdcall vkBeginCommandBuffer(ptr ptr) winevulkan.wine_vkBeginCommandBuffer
@ stdcall vkBindBufferMemory(ptr int64 int64 int64) winevulkan.wine_vkBindBufferMemory
@ stdcall vkBindImageMemory(ptr int64 int64 int64) winevulkan.wine_vkBindImageMemory
@ stdcall vkCmdBeginQuery(ptr int64 long long) winevulkan.wine_vkCmdBeginQuery
@ stdcall vkCmdBeginRenderPass(ptr ptr long) winevulkan.wine_vkCmdBeginRenderPass
@ stdcall vkCmdBindDescriptorSets(ptr long int64 long long ptr long ptr) winevulkan.wine_vkCmdBindDescriptorSets
@ stdcall vkCmdBindIndexBuffer(ptr int64 int64 long) winevulkan.wine_vkCmdBindIndexBuffer
@ stdcall vkCmdBindPipeline(ptr long int64) winevulkan.wine_vkCmdBindPipeline
@ stdcall vkCmdBindVertexBuffers(ptr long long ptr ptr) winevulkan.wine_vkCmdBindVertexBuffers
@ stdcall vkCmdBlitImage(ptr int64 long int64 long long ptr long) winevulkan.wine_vkCmdBlitImage
@ stdcall vkCmdClearAttachments(ptr long ptr long ptr) winevulkan.wine_vkCmdClearAttachments
@ stdcall vkCmdClearColorImage(ptr int64 long ptr long ptr) winevulkan.wine_vkCmdClearColorImage
@ stdcall vkCmdClearDepthStencilImage(ptr int64 long ptr long ptr) winevulkan.wine_vkCmdClearDepthStencilImage
@ stdcall vkCmdCopyBuffer(ptr int64 int64 long ptr) winevulkan.wine_vkCmdCopyBuffer
@ stdcall vkCmdCopyBufferToImage(ptr int64 int64 long long ptr) winevulkan.wine_vkCmdCopyBufferToImage
@ stdcall vkCmdCopyImage(ptr int64 long int64 long long ptr) winevulkan.wine_vkCmdCopyImage
@ stdcall vkCmdCopyImageToBuffer(ptr int64 long int64 long ptr) winevulkan.wine_vkCmdCopyImageToBuffer
@ stdcall vkCmdCopyQueryPoolResults(ptr int64 long long int64 int64 int64 long) winevulkan.wine_vkCmdCopyQueryPoolResults
@ stdcall vkCmdDispatch(ptr long long long) winevulkan.wine_vkCmdDispatch
@ stdcall vkCmdDispatchIndirect(ptr int64 int64) winevulkan.wine_vkCmdDispatchIndirect
@ stdcall vkCmdDraw(ptr long long long long) winevulkan.wine_vkCmdDraw
@ stdcall vkCmdDrawIndexed(ptr long long long long long) winevulkan.wine_vkCmdDrawIndexed
@ stdcall vkCmdDrawIndexedIndirect(ptr int64 int64 long long) winevulkan.wine_vkCmdDrawIndexedIndirect
@ stdcall vkCmdDrawIndirect(ptr int64 int64 long long) winevulkan.wine_vkCmdDrawIndirect
@ stdcall vkCmdEndQuery(ptr int64 long) winevulkan.wine_vkCmdEndQuery
@ stdcall vkCmdEndRenderPass(ptr) winevulkan.wine_vkCmdEndRenderPass
@ stdcall vkCmdExecuteCommands(ptr long ptr) winevulkan.wine_vkCmdExecuteCommands
@ stdcall vkCmdFillBuffer(ptr int64 int64 int64 long) winevulkan.wine_vkCmdFillBuffer
@ stdcall vkCmdNextSubpass(ptr long) winevulkan.wine_vkCmdNextSubpass
@ stdcall vkCmdPipelineBarrier(ptr long long long long ptr long ptr long ptr) winevulkan.wine_vkCmdPipelineBarrier
@ stdcall vkCmdPushConstants(ptr int64 long long long ptr) winevulkan.wine_vkCmdPushConstants
@ stdcall vkCmdResetEvent(ptr int64 long) winevulkan.wine_vkCmdResetEvent
@ stdcall vkCmdResetQueryPool(ptr int64 long long) winevulkan.wine_vkCmdResetQueryPool
@ stdcall vkCmdResolveImage(ptr int64 long int64 long long ptr) winevulkan.wine_vkCmdResolveImage
@ stdcall vkCmdSetBlendConstants(ptr ptr) winevulkan.wine_vkCmdSetBlendConstants
@ stdcall vkCmdSetDepthBias(ptr float float float) winevulkan.wine_vkCmdSetDepthBias
@ stdcall vkCmdSetDepthBounds(ptr float float) winevulkan.wine_vkCmdSetDepthBounds
@ stdcall vkCmdSetEvent(ptr int64 long) winevulkan.wine_vkCmdSetEvent
@ stdcall vkCmdSetLineWidth(ptr float) winevulkan.wine_vkCmdSetLineWidth
@ stdcall vkCmdSetScissor(ptr long long ptr) winevulkan.wine_vkCmdSetScissor
@ stdcall vkCmdSetStencilCompareMask(ptr long long) winevulkan.wine_vkCmdSetStencilCompareMask
@ stdcall vkCmdSetStencilReference(ptr long long) winevulkan.wine_vkCmdSetStencilReference
@ stdcall vkCmdSetStencilWriteMask(ptr long long) winevulkan.wine_vkCmdSetStencilWriteMask
@ stdcall vkCmdSetViewport(ptr long long ptr) winevulkan.wine_vkCmdSetViewport
@ stdcall vkCmdUpdateBuffer(ptr int64 int64 int64 ptr) winevulkan.wine_vkCmdUpdateBuffer
@ stdcall vkCmdWaitEvents(ptr long ptr long long long ptr long ptr long ptr) winevulkan.wine_vkCmdWaitEvents
@ stdcall vkCmdWriteTimestamp(ptr long int64 long) winevulkan.wine_vkCmdWriteTimestamp
@ stdcall vkCreateBuffer(ptr ptr ptr ptr) winevulkan.wine_vkCreateBuffer
@ stdcall vkCreateBufferView(ptr ptr ptr ptr) winevulkan.wine_vkCreateBufferView
@ stdcall vkCreateCommandPool(ptr ptr ptr ptr) winevulkan.wine_vkCreateCommandPool
@ stdcall vkCreateComputePipelines(ptr int64 long ptr ptr ptr) winevulkan.wine_vkCreateComputePipelines
@ stdcall vkCreateDescriptorPool(ptr ptr ptr ptr) winevulkan.wine_vkCreateDescriptorPool
@ stdcall vkCreateDescriptorSetLayout(ptr ptr ptr ptr) winevulkan.wine_vkCreateDescriptorSetLayout
@ stdcall vkCreateDevice(ptr ptr ptr ptr) winevulkan.wine_vkCreateDevice
@ stub vkCreateDisplayModeKHR
@ stub vkCreateDisplayPlaneSurfaceKHR
@ stdcall vkCreateEvent(ptr ptr ptr ptr) winevulkan.wine_vkCreateEvent
@ stdcall vkCreateFence(ptr ptr ptr ptr) winevulkan.wine_vkCreateFence
@ stdcall vkCreateFramebuffer(ptr ptr ptr ptr) winevulkan.wine_vkCreateFramebuffer
@ stdcall vkCreateGraphicsPipelines(ptr int64 long ptr ptr ptr) winevulkan.wine_vkCreateGraphicsPipelines
@ stdcall vkCreateImage(ptr ptr ptr ptr) winevulkan.wine_vkCreateImage
@ stdcall vkCreateImageView(ptr ptr ptr ptr) winevulkan.wine_vkCreateImageView
@ stdcall vkCreateInstance(ptr ptr ptr) winevulkan.wine_vkCreateInstance
@ stdcall vkCreatePipelineCache(ptr ptr ptr ptr) winevulkan.wine_vkCreatePipelineCache
@ stdcall vkCreatePipelineLayout(ptr ptr ptr ptr) winevulkan.wine_vkCreatePipelineLayout
@ stdcall vkCreateQueryPool(ptr ptr ptr ptr) winevulkan.wine_vkCreateQueryPool
@ stdcall vkCreateRenderPass(ptr ptr ptr ptr) winevulkan.wine_vkCreateRenderPass
@ stdcall vkCreateSampler(ptr ptr ptr ptr) winevulkan.wine_vkCreateSampler
@ stdcall vkCreateSemaphore(ptr ptr ptr ptr) winevulkan.wine_vkCreateSemaphore
@ stdcall vkCreateShaderModule(ptr ptr ptr ptr) winevulkan.wine_vkCreateShaderModule
@ stub vkCreateSharedSwapchainsKHR
@ stdcall vkCreateSwapchainKHR(ptr ptr ptr ptr) winevulkan.wine_vkCreateSwapchainKHR
@ stdcall vkCreateWin32SurfaceKHR(ptr ptr ptr ptr) winevulkan.wine_vkCreateWin32SurfaceKHR
@ stdcall vkDestroyBuffer(ptr int64 ptr) winevulkan.wine_vkDestroyBuffer
@ stdcall vkDestroyBufferView(ptr int64 ptr) winevulkan.wine_vkDestroyBufferView
@ stdcall vkDestroyCommandPool(ptr int64 ptr) winevulkan.wine_vkDestroyCommandPool
@ stdcall vkDestroyDescriptorPool(ptr int64 ptr) winevulkan.wine_vkDestroyDescriptorPool
@ stdcall vkDestroyDescriptorSetLayout(ptr int64 ptr) winevulkan.wine_vkDestroyDescriptorSetLayout
@ stdcall vkDestroyDevice(ptr ptr) winevulkan.wine_vkDestroyDevice
@ stdcall vkDestroyEvent(ptr int64 ptr) winevulkan.wine_vkDestroyEvent
@ stdcall vkDestroyFence(ptr int64 ptr) winevulkan.wine_vkDestroyFence
@ stdcall vkDestroyFramebuffer(ptr int64 ptr) winevulkan.wine_vkDestroyFramebuffer
@ stdcall vkDestroyImage(ptr int64 ptr) winevulkan.wine_vkDestroyImage
@ stdcall vkDestroyImageView(ptr int64 ptr) winevulkan.wine_vkDestroyImageView
@ stdcall vkDestroyInstance(ptr ptr) winevulkan.wine_vkDestroyInstance
@ stdcall vkDestroyPipeline(ptr int64 ptr) winevulkan.wine_vkDestroyPipeline
@ stdcall vkDestroyPipelineCache(ptr int64 ptr) winevulkan.wine_vkDestroyPipelineCache
@ stdcall vkDestroyPipelineLayout(ptr int64 ptr) winevulkan.wine_vkDestroyPipelineLayout
@ stdcall vkDestroyQueryPool(ptr int64 ptr) winevulkan.wine_vkDestroyQueryPool
@ stdcall vkDestroyRenderPass(ptr int64 ptr) winevulkan.wine_vkDestroyRenderPass
@ stdcall vkDestroySampler(ptr int64 ptr) winevulkan.wine_vkDestroySampler
@ stdcall vkDestroySemaphore(ptr int64 ptr) winevulkan.wine_vkDestroySemaphore
@ stdcall vkDestroyShaderModule(ptr int64 ptr) winevulkan.wine_vkDestroyShaderModule
@ stdcall vkDestroySurfaceKHR(ptr int64 ptr) winevulkan.wine_vkDestroySurfaceKHR
@ stdcall vkDestroySwapchainKHR(ptr int64 ptr) winevulkan.wine_vkDestroySwapchainKHR
@ stdcall vkDeviceWaitIdle(ptr) winevulkan.wine_vkDeviceWaitIdle
@ stdcall vkEndCommandBuffer(ptr) winevulkan.wine_vkEndCommandBuffer
@ stdcall vkEnumerateDeviceExtensionProperties(ptr str ptr ptr) winevulkan.wine_vkEnumerateDeviceExtensionProperties
@ stdcall vkEnumerateDeviceLayerProperties(ptr ptr ptr) winevulkan.wine_vkEnumerateDeviceLayerProperties
@ stdcall vkEnumerateInstanceExtensionProperties(str ptr ptr)
@ stdcall vkEnumerateInstanceLayerProperties(ptr ptr)
@ stdcall vkEnumeratePhysicalDevices(ptr ptr ptr) winevulkan.wine_vkEnumeratePhysicalDevices
@ stdcall vkFlushMappedMemoryRanges(ptr long ptr) winevulkan.wine_vkFlushMappedMemoryRanges
@ stdcall vkFreeCommandBuffers(ptr int64 long ptr) winevulkan.wine_vkFreeCommandBuffers
@ stdcall vkFreeDescriptorSets(ptr int64 long ptr) winevulkan.wine_vkFreeDescriptorSets
@ stdcall vkFreeMemory(ptr int64 ptr) winevulkan.wine_vkFreeMemory
@ stdcall vkGetBufferMemoryRequirements(ptr int64 ptr) winevulkan.wine_vkGetBufferMemoryRequirements
@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.wine_vkGetDeviceMemoryCommitment
@ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.wine_vkGetDeviceProcAddr
@ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.wine_vkGetDeviceQueue
@ stub vkGetDisplayModePropertiesKHR
@ stub vkGetDisplayPlaneCapabilitiesKHR
@ stub vkGetDisplayPlaneSupportedDisplaysKHR
@ stdcall vkGetEventStatus(ptr int64) winevulkan.wine_vkGetEventStatus
@ stdcall vkGetFenceStatus(ptr int64) winevulkan.wine_vkGetFenceStatus
@ stdcall vkGetImageMemoryRequirements(ptr int64 ptr) winevulkan.wine_vkGetImageMemoryRequirements
@ stdcall vkGetImageSparseMemoryRequirements(ptr int64 ptr ptr) winevulkan.wine_vkGetImageSparseMemoryRequirements
@ stdcall vkGetImageSubresourceLayout(ptr int64 ptr ptr) winevulkan.wine_vkGetImageSubresourceLayout
@ stdcall vkGetInstanceProcAddr(ptr str)
@ stub vkGetPhysicalDeviceDisplayPlanePropertiesKHR
@ stub vkGetPhysicalDeviceDisplayPropertiesKHR
@ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) winevulkan.wine_vkGetPhysicalDeviceFeatures
@ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) winevulkan.wine_vkGetPhysicalDeviceFormatProperties
@ stdcall vkGetPhysicalDeviceImageFormatProperties(ptr long long long long long ptr) winevulkan.wine_vkGetPhysicalDeviceImageFormatProperties
@ stdcall vkGetPhysicalDeviceMemoryProperties(ptr ptr) winevulkan.wine_vkGetPhysicalDeviceMemoryProperties
@ stdcall vkGetPhysicalDeviceProperties(ptr ptr) winevulkan.wine_vkGetPhysicalDeviceProperties
@ stdcall vkGetPhysicalDeviceQueueFamilyProperties(ptr ptr ptr) winevulkan.wine_vkGetPhysicalDeviceQueueFamilyProperties
@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties(ptr long long long long long ptr ptr) winevulkan.wine_vkGetPhysicalDeviceSparseImageFormatProperties
@ stdcall vkGetPhysicalDeviceSurfaceCapabilitiesKHR(ptr int64 ptr) winevulkan.wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
@ stdcall vkGetPhysicalDeviceSurfaceFormatsKHR(ptr int64 ptr ptr) winevulkan.wine_vkGetPhysicalDeviceSurfaceFormatsKHR
@ stdcall vkGetPhysicalDeviceSurfacePresentModesKHR(ptr int64 ptr long) winevulkan.wine_vkGetPhysicalDeviceSurfacePresentModesKHR
@ stdcall vkGetPhysicalDeviceSurfaceSupportKHR(ptr long int64 ptr) winevulkan.wine_vkGetPhysicalDeviceSurfaceSupportKHR
@ stdcall vkGetPhysicalDeviceWin32PresentationSupportKHR(ptr long) winevulkan.wine_vkGetPhysicalDeviceWin32PresentationSupportKHR
@ stdcall vkGetPipelineCacheData(ptr int64 ptr ptr) winevulkan.wine_vkGetPipelineCacheData
@ stdcall vkGetQueryPoolResults(ptr int64 long long long ptr int64 long) winevulkan.wine_vkGetQueryPoolResults
@ stdcall vkGetRenderAreaGranularity(ptr int64 ptr) winevulkan.wine_vkGetRenderAreaGranularity
@ stdcall vkGetSwapchainImagesKHR(ptr int64 ptr ptr) winevulkan.wine_vkGetSwapchainImagesKHR
@ stdcall vkInvalidateMappedMemoryRanges(ptr long ptr) winevulkan.wine_vkInvalidateMappedMemoryRanges
@ stdcall vkMapMemory(ptr int64 int64 int64 long ptr) winevulkan.wine_vkMapMemory
@ stdcall vkMergePipelineCaches(ptr int64 long ptr) winevulkan.wine_vkMergePipelineCaches
@ stdcall vkQueueBindSparse(ptr long ptr int64) winevulkan.wine_vkQueueBindSparse
@ stdcall vkQueuePresentKHR(ptr ptr) winevulkan.wine_vkQueuePresentKHR
@ stdcall vkQueueSubmit(ptr long ptr int64) winevulkan.wine_vkQueueSubmit
@ stdcall vkQueueWaitIdle(ptr) winevulkan.wine_vkQueueWaitIdle
@ stdcall vkResetCommandBuffer(ptr long) winevulkan.wine_vkResetCommandBuffer
@ stdcall vkResetCommandPool(ptr int64 long) winevulkan.wine_vkResetCommandPool
@ stdcall vkResetDescriptorPool(ptr int64 long) winevulkan.wine_vkResetDescriptorPool
@ stdcall vkResetEvent(ptr int64) winevulkan.wine_vkResetEvent
@ stdcall vkResetFences(ptr long ptr) winevulkan.wine_vkResetFences
@ stdcall vkSetEvent(ptr int64) winevulkan.wine_vkSetEvent
@ stdcall vkUnmapMemory(ptr int64) winevulkan.wine_vkUnmapMemory
@ stdcall vkUpdateDescriptorSets(ptr long ptr long ptr) winevulkan.wine_vkUpdateDescriptorSets
@ stdcall vkWaitForFences(ptr long ptr long int64) winevulkan.wine_vkWaitForFences

68
dlls/vulkan-1/vulkan.c Normal file
View File

@ -0,0 +1,68 @@
/* Wine Vulkan loader implementation
*
* Copyright 2018 Roderick Colenbrander
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "wine/vulkan.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
VkResult WINAPI vkEnumerateInstanceExtensionProperties(const char *layer_name,
uint32_t *count, VkExtensionProperties *properties)
{
FIXME("stub: %p %p %p\n", layer_name, count, properties);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
VkResult WINAPI vkEnumerateInstanceLayerProperties(uint32_t *count,
VkLayerProperties *properties)
{
TRACE("%p, %p\n", count, properties);
/* We don't support any layers. */
*count = 0;
return VK_SUCCESS;
}
PFN_vkVoidFunction WINAPI vkGetInstanceProcAddr(VkInstance instance, const char *name)
{
FIXME("stub: %p %s\n", instance, debugstr_a(name));
return NULL;
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
{
TRACE("(%p, %u, %p)\n", hinst, reason, reserved);
switch (reason)
{
case DLL_WINE_PREATTACH:
/* Prefer native as it provides more functionality. */
return FALSE;
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinst);
return TRUE;
}
return TRUE;
}

View File

@ -65,6 +65,7 @@ LOGGER.addHandler(logging.StreamHandler())
# Filenames to create.
WINE_VULKAN_H = "../../include/wine/vulkan.h"
WINE_VULKAN_DRIVER_H = "../../include/wine/vulkan_driver.h"
WINE_VULKAN_LOADER_SPEC = "../vulkan-1/vulkan-1.spec"
WINE_VULKAN_SPEC = "winevulkan.spec"
WINE_VULKAN_THUNKS_C = "vulkan_thunks.c"
WINE_VULKAN_THUNKS_H = "vulkan_thunks.h"
@ -570,18 +571,26 @@ class VkFunction(object):
return body
def spec(self, prefix=None):
def spec(self, prefix=None, symbol=None):
""" Generate spec file entry for this function.
Args
prefix (str, optional): prefix to prepend to entry point name.
symbol (str, optional): allows to override function name implementing entry point.
"""
spec = ""
params = " ".join([p.spec() for p in self.params])
if prefix is not None:
return "@ stdcall {0}{1}({2})\n".format(prefix, self.name, params)
spec += "@ stdcall {0}{1}({2})".format(prefix, self.name, params)
else:
return "@ stdcall {0}({1})\n".format(self.name, params)
spec += "@ stdcall {0}({1})".format(self.name, params)
if symbol is not None:
spec += " " + symbol
spec += "\n"
return spec
def stub(self, call_conv=None, prefix=None):
stub = self.prototype(call_conv=call_conv, prefix=prefix)
@ -2136,6 +2145,26 @@ class VkGenerator(object):
else:
f.write("@ stub {0}\n".format(func.name))
def generate_vulkan_loader_spec(self, f):
f.write("# Automatically generated from Vulkan vk.xml; DO NOT EDIT!\n\n")
# Export symbols for all Vulkan Core functions.
for func in self.registry.funcs.values():
if not func.is_core_func():
continue
# We support all Core functions except for VK_KHR_display* APIs.
# Create stubs for unsupported Core functions.
if func.is_required():
# Global functions need a custom implementation, except for
# vkCreateInstance, which we can just forward.
if func.is_global_func() and func.name != "vkCreateInstance":
f.write(func.spec())
else:
f.write(func.spec(symbol="winevulkan.wine_" + func.name))
else:
f.write("@ stub {0}\n".format(func.name))
class VkRegistry(object):
def __init__(self, reg_filename):
@ -2521,5 +2550,8 @@ def main():
with open(WINE_VULKAN_SPEC, "w") as f:
generator.generate_vulkan_spec(f)
with open(WINE_VULKAN_LOADER_SPEC, "w") as f:
generator.generate_vulkan_loader_spec(f)
if __name__ == "__main__":
main()