Commit b2cc53d3 authored by Liam Middlebrook's avatar Liam Middlebrook Committed by Alexandre Julliard

winevulkan: Allow some experimental VK extensions to be translated.

parent 9e448142
......@@ -1443,6 +1443,16 @@ void WINAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const Vk
unix_funcs->p_vkGetImageSubresourceLayout(device, image, pSubresource, pLayout);
}
VkResult WINAPI vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties)
{
return unix_funcs->p_vkGetImageViewAddressNVX(device, imageView, pProperties);
}
uint32_t WINAPI vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo)
{
return unix_funcs->p_vkGetImageViewHandleNVX(device, pInfo);
}
VkResult WINAPI vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties)
{
return unix_funcs->p_vkGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, pMemoryHostPointerProperties);
......@@ -2222,6 +2232,8 @@ static const struct vulkan_func vk_device_dispatch_table[] =
{"vkGetImageSparseMemoryRequirements2", &vkGetImageSparseMemoryRequirements2},
{"vkGetImageSparseMemoryRequirements2KHR", &vkGetImageSparseMemoryRequirements2KHR},
{"vkGetImageSubresourceLayout", &vkGetImageSubresourceLayout},
{"vkGetImageViewAddressNVX", &vkGetImageViewAddressNVX},
{"vkGetImageViewHandleNVX", &vkGetImageViewHandleNVX},
{"vkGetMemoryHostPointerPropertiesEXT", &vkGetMemoryHostPointerPropertiesEXT},
{"vkGetPerformanceParameterINTEL", &vkGetPerformanceParameterINTEL},
{"vkGetPipelineCacheData", &vkGetPipelineCacheData},
......
......@@ -303,6 +303,8 @@ struct unix_funcs
void (WINAPI *p_vkGetImageSparseMemoryRequirements2)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *);
void (WINAPI *p_vkGetImageSparseMemoryRequirements2KHR)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *);
void (WINAPI *p_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *);
VkResult (WINAPI *p_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *);
uint32_t (WINAPI *p_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *);
VkResult (WINAPI *p_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *);
VkResult (WINAPI *p_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *);
VkResult (WINAPI *p_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice, uint32_t *, VkTimeDomainEXT *);
......
......@@ -131,6 +131,13 @@ CORE_EXTENSIONS = [
"VK_KHR_win32_surface",
]
# Some experimental extensions are used by shipping applications so their API is extremely unlikely
# to change in a backwards-incompatible way. Allow translation of those extensions with WineVulkan.
ALLOWED_X_EXTENSIONS = [
"VK_NVX_binary_import",
"VK_NVX_image_view_handle",
]
# Functions part of our winevulkan graphics driver interface.
# DRIVER_VERSION should be bumped on any change to driver interface
# in FUNCTION_OVERRIDES
......@@ -3095,7 +3102,7 @@ class VkRegistry(object):
# Disable highly experimental extensions as the APIs are unstable and can
# change between minor Vulkan revisions until API is final and becomes KHR
# or NV.
if "KHX" in ext_name or "NVX" in ext_name:
if ("KHX" in ext_name or "NVX" in ext_name) and ext_name not in ALLOWED_X_EXTENSIONS:
LOGGER.debug("Skipping experimental extension: {0}".format(ext_name))
skipped_exts.append(ext_name)
return
......
......@@ -1514,6 +1514,35 @@ static inline void convert_VkSubresourceLayout_host_to_win(const VkSubresourceLa
out->depthPitch = in->depthPitch;
}
static inline void convert_VkImageViewAddressPropertiesNVX_win_to_host(const VkImageViewAddressPropertiesNVX *in, VkImageViewAddressPropertiesNVX_host *out)
{
if (!in) return;
out->pNext = in->pNext;
out->sType = in->sType;
}
static inline void convert_VkImageViewAddressPropertiesNVX_host_to_win(const VkImageViewAddressPropertiesNVX_host *in, VkImageViewAddressPropertiesNVX *out)
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->deviceAddress = in->deviceAddress;
out->size = in->size;
}
static inline void convert_VkImageViewHandleInfoNVX_win_to_host(const VkImageViewHandleInfoNVX *in, VkImageViewHandleInfoNVX_host *out)
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->imageView = in->imageView;
out->descriptorType = in->descriptorType;
out->sampler = in->sampler;
}
static inline void convert_VkImageFormatProperties_host_to_win(const VkImageFormatProperties_host *in, VkImageFormatProperties *out)
{
if (!in) return;
......@@ -6294,6 +6323,41 @@ void WINAPI wine_vkGetImageSubresourceLayout(VkDevice device, VkImage image, con
#endif
}
static VkResult WINAPI wine_vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties)
{
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkImageViewAddressPropertiesNVX_host pProperties_host;
TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(imageView), pProperties);
convert_VkImageViewAddressPropertiesNVX_win_to_host(pProperties, &pProperties_host);
result = device->funcs.p_vkGetImageViewAddressNVX(device->device, imageView, &pProperties_host);
convert_VkImageViewAddressPropertiesNVX_host_to_win(&pProperties_host, pProperties);
return result;
#else
TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(imageView), pProperties);
return device->funcs.p_vkGetImageViewAddressNVX(device->device, imageView, pProperties);
#endif
}
static uint32_t WINAPI wine_vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo)
{
#if defined(USE_STRUCT_CONVERSION)
uint32_t result;
VkImageViewHandleInfoNVX_host pInfo_host;
TRACE("%p, %p\n", device, pInfo);
convert_VkImageViewHandleInfoNVX_win_to_host(pInfo, &pInfo_host);
result = device->funcs.p_vkGetImageViewHandleNVX(device->device, &pInfo_host);
return result;
#else
TRACE("%p, %p\n", device, pInfo);
return device->funcs.p_vkGetImageViewHandleNVX(device->device, pInfo);
#endif
}
static VkResult WINAPI wine_vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties)
{
TRACE("%p, %#x, %p, %p\n", device, handleType, pHostPointer, pMemoryHostPointerProperties);
......@@ -7221,6 +7285,7 @@ static const char * const vk_device_extensions[] =
"VK_KHR_vulkan_memory_model",
"VK_KHR_workgroup_memory_explicit_layout",
"VK_KHR_zero_initialize_workgroup_memory",
"VK_NVX_image_view_handle",
"VK_NV_clip_space_w_scaling",
"VK_NV_compute_shader_derivatives",
"VK_NV_cooperative_matrix",
......@@ -7628,6 +7693,8 @@ const struct unix_funcs loader_funcs =
&wine_vkGetImageSparseMemoryRequirements2,
&wine_vkGetImageSparseMemoryRequirements2KHR,
&wine_vkGetImageSubresourceLayout,
&wine_vkGetImageViewAddressNVX,
&wine_vkGetImageViewHandleNVX,
&wine_vkGetMemoryHostPointerPropertiesEXT,
&wine_vkGetPerformanceParameterINTEL,
&wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT,
......
......@@ -968,6 +968,25 @@ typedef struct VkSubresourceLayout_host
} VkSubresourceLayout_host;
typedef struct VkImageViewAddressPropertiesNVX_host
{
VkStructureType sType;
void *pNext;
VkDeviceAddress deviceAddress;
VkDeviceSize size;
} VkImageViewAddressPropertiesNVX_host;
typedef struct VkImageViewHandleInfoNVX_host
{
VkStructureType sType;
const void *pNext;
VkImageView imageView;
VkDescriptorType descriptorType;
VkSampler sampler;
} VkImageViewHandleInfoNVX_host;
typedef struct VkImageFormatProperties_host
{
VkExtent3D maxExtent;
......@@ -1933,6 +1952,16 @@ struct vulkan_device_funcs
#else
void (*p_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *);
#endif
#if defined(USE_STRUCT_CONVERSION)
VkResult (*p_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX_host *);
#else
VkResult (*p_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *);
#endif
#if defined(USE_STRUCT_CONVERSION)
uint32_t (*p_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX_host *);
#else
uint32_t (*p_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *);
#endif
VkResult (*p_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *);
VkResult (*p_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *);
VkResult (*p_vkGetPipelineCacheData)(VkDevice, VkPipelineCache, size_t *, void *);
......@@ -2415,6 +2444,8 @@ struct vulkan_instance_funcs
USE_VK_FUNC(vkGetImageSparseMemoryRequirements2) \
USE_VK_FUNC(vkGetImageSparseMemoryRequirements2KHR) \
USE_VK_FUNC(vkGetImageSubresourceLayout) \
USE_VK_FUNC(vkGetImageViewAddressNVX) \
USE_VK_FUNC(vkGetImageViewHandleNVX) \
USE_VK_FUNC(vkGetMemoryHostPointerPropertiesEXT) \
USE_VK_FUNC(vkGetPerformanceParameterINTEL) \
USE_VK_FUNC(vkGetPipelineCacheData) \
......
......@@ -91,6 +91,8 @@
#define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1
#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback"
#define VK_NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION 2
#define VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME "VK_NVX_image_view_handle"
#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 2
#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
......@@ -2996,6 +2998,8 @@ typedef enum VkStructureType
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001,
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002,
VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = 1000030000,
VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = 1000030001,
VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000,
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000,
......@@ -6045,6 +6049,14 @@ typedef struct VkImageSubresourceLayers
uint32_t layerCount;
} VkImageSubresourceLayers;
typedef struct VkImageViewAddressPropertiesNVX
{
VkStructureType sType;
void *pNext;
VkDeviceAddress deviceAddress;
VkDeviceSize WINE_VK_ALIGN(8) size;
} VkImageViewAddressPropertiesNVX;
typedef struct VkIndirectCommandsLayoutCreateInfoNV
{
VkStructureType sType;
......@@ -7119,6 +7131,15 @@ typedef struct VkImageResolve
VkExtent3D extent;
} VkImageResolve;
typedef struct VkImageViewHandleInfoNVX
{
VkStructureType sType;
const void *pNext;
VkImageView WINE_VK_ALIGN(8) imageView;
VkDescriptorType descriptorType;
VkSampler WINE_VK_ALIGN(8) sampler;
} VkImageViewHandleInfoNVX;
typedef struct VkIndirectCommandsStreamNV
{
VkBuffer WINE_VK_ALIGN(8) buffer;
......@@ -8990,6 +9011,8 @@ typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice, VkIma
typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *);
typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *);
typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *);
typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *);
typedef uint32_t (VKAPI_PTR *PFN_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *);
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance, const char *);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *);
typedef VkResult (VKAPI_PTR *PFN_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *);
......@@ -9387,6 +9410,8 @@ void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage imag
void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements);
void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements);
void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout);
VkResult VKAPI_CALL vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties);
uint32_t VKAPI_CALL vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo);
PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName);
VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties);
VkResult VKAPI_CALL vkGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL *pValue);
......
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